Date and Time Format Conversion in Pandas, Python
get the date from the column using df['Month'].dt.date
Initially, my dataframe had a Month column containing numbers representing the months.




Month




1


2


3


4




I typed df["Month"] = pd.to_datetime(df["Month"]) and I get this...




Month




970-01-01 00:00:00.0000000001


1970-01-01 00:00:00.000000002


1970-01-01 00:00:00.000000003


1970-01-01 00:00:00.000000004




I would like to just retain just the dates and not the time. Any solutions?