I have DataFrame in which there is a column with event dates (dates are not unique). I need to select all the data that is in this period. I try next:
start_day = datetime.date(datetime.strptime(start_day, '%d.%m.%Y')) #change user data to date format
end_day = datetime.date(datetime.strptime(end_day, '%d.%m.%Y'))
df = df[df['Transaction_date'].between(start_day, end_day)]
The type of column Transaction_date
is datetime64[ns]
.
When I run the code with the request for the period 01/01/2020
to 31/01/2020
- part of the data for the specified period is lost (information is displayed only for 21 days, it should be for 31 days).
I see that the Data Frame is contained data for the entire requested period. Can you help me please, where is my mistake?