Reputation: 37
I am trying to convert timestamps to string dates in a dataframe proceeding this way:
def ts_to_date(ts):
return str(ts.date)
display(table["event_date_and_time"].apply(ts_to_date))
The issue is that the resulting pandas serie is filled with built-in method date of Timestamp object at 0... and not with the converted timestamps. What do I do wrong ?
Thank you in advance
Upvotes: 0
Views: 1645
Reputation: 352
You forgot the parantheses after .date :
def ts_to_date(ts):
return str(ts.date())
Upvotes: 1