0

I'm kinda new in Python.. help me find the solution.. I would like to convert iso-like date such as "2022-10-28T08:00:19Z" in a dataframe column into readable like '2022-10-28' or '28-10'2022' so I can filter and count the data if date >= '01-01-2022' then show the data.

this is the example of data:

date_published

2022-10-28T08:00:19Z
2022-10-28T05:00:08Z
2022-10-28T03:00:13Z
2022-10-27T13:55:38Z
2022-10-27T13:21:36Z
spiderboy
  • 7
  • 2

1 Answers1

0
df['date_published']=pd.to_datetime(df['date_published']).dt.date
Naveed
  • 11,495
  • 2
  • 14
  • 21