Extract all data of a month from different years
Ok I had a typo in this question before which I have now corrected: my database (df_e) looks like this:
0,Country,Latitude,Longitude,Altitude,Date,H2,Year,month,dates,a_diffH,H2a
1,IN,28.58,77.2,212,1964-09-15,-57.6,1964,9,1964-09-15,-3.18,-54.42
2,IN,28.58,77.2,212,1963-09-15,-120.0,1963,9,1963-09-15,-3.18,-116.82
3,IN,28.58,77.2,212,1964-05-15,28.2,1964,5,1964-05-15,-3.18,31.38
...
and I would like to save the data from the 9th month from the years 1963 and 1964 into a new df. For this I use the command:
df.loc[df_e['H2a'].isin(['1963-09-15', '1964-09-15'])]
But the result is
Empty DataFrame
Columns: [Country, Latitude, Longitude, Altitude, Date, H2, Year, month, dates, a_diffH, H2a]
Index: []
Where is my mistake?
Topic time-series pandas dataset python
Category Data Science