Issue
I need to merge 2 pandas dataframes together on dates, but they currently have different date types. 1 is timestamp (imported from excel) and the other is datetime.date
.
Any advice?
I've tried pd.to_datetime().date
but this only works on a single item(e.g. df.ix[0,0]
), it won't let me apply to the entire series (e.g. df['mydates']
) or the dataframe.
Solution
I got some help from a colleague.
This appears to solve the problem posted above
pd.to_datetime(df['mydates']).apply(lambda x: x.date())
Answered By - Afo B
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.