I am in a fix what to do. I need year wise date time data for time series analysis (like 1974, 1975 ... 2020). But I am getting 1970 in every row. Can anyone help please?
Asked
Active
Viewed 35 times
-3
-
Could you add your code and a sample data as text please. – Abhi_J Mar 20 '21 at 18:18
-
Please read https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples – Vishnudev Krishnadas Mar 20 '21 at 18:23
1 Answers
0
Try below formatting for date.
df.Period = pd.to_datetime(df.Period, format='%Y')

Paras Gupta
- 174
- 4
-
It is really helpful. Thank You so much for your kind and effective support. – Eyasir Arafath Mar 20 '21 at 18:26