Here is my dataset:
And want to convert my dataset between two dates. I have tried the solution mentioned here. But it didn't work.
Here is a screenshot using:
Boolean Mask
and
DatetimeIndex
Here is my dataset:
And want to convert my dataset between two dates. I have tried the solution mentioned here. But it didn't work.
Here is a screenshot using:
Boolean Mask
and
DatetimeIndex
I tried to recreate the scenario shared by you with the same data. While exploring the results, I observed that the data is not in sorted format.
Try to run sort_values('Date')
on your result.
data[(data['Date'] >= '2020-03-25') & (data['Date'] <= '2020-05-22')].sort_values('Date')
You will get above result.