I have a pandas data frame mydf that has two columns,and both columns are datetime datatypes: mydate and mytime. I want to add three more
mydf
mydate
mytime
def getWd(d): d.isocalendar()[1], d.weekday() def getH(t): return t.hour mydf["hour"] = zip(*df["mytime"].map(getH)) mydf["weekday"], mydf["weeknum"] = zip(*df["mydate"].map(getWd))