I have this dataframe in python done in pandas:
0
0 2018-06-29
1 2018-10-29
2 2019-02-28
3 2019-06-29
4 2019-10-29
5 2020-02-29
6 2020-06-29
7 2020-10-29
8 2021-02-28
Then I have a date that is the next one:
[datetime.date(2020, 2, 29)]
I want to filter the data frame to get just the dates that are <= that the date I have. I tried this with loc[] but I get the next output:
Seleccion = df.loc[df[0] < date]
Arrays were different lengths: 9 vs 1
I don't know if there is a way to do that, but if it is, any help would be perfect. Thank you for taking your time.
.ilocjust doselection = df[df['0'] < date]