Lambda is confusing me a little, here is what I've got :
lmb = lambda d: datetime.datetime.strptime(d["Date[G]"]+"-"+d["Time[G]"], "%d-%b-%Y-%H:%M:%S.%f")
if I write a function like this :
def time(d):
t = datetime.datetime.strptime(d["Date[G]"]+"-"+d["Time[G]"], "%d-%b-%Y-%H:%M:%S.%f")
return t.strftime("%d-%b-%Y-%H")
I can return t.strftime("%d-%b-%Y-%H").
Can I embed a somethine like t.strftime("%d-%b-%Y-%H") in my lambda statement ?
EDIT
I`ve tried this :
lmb = lambda d: datetime.datetime.strptime(d["Date[G]"]+"-"+d["Time[G]"], "%d-%b-%Y-%H:%M:%S.%f").strftime("%d-%b-%Y-%H")
but it returns :
AttributeError: 'str' object has no attribute 'strftime'
which doesn't happen using the function ..