I want to choose certain days from a dataframe. I have tried this code. It seems to work, but when I select a longer period of days, for example from 10.03.2020 to 20.03.2020, it returns only days from 13 to 20. I want to see the values from the dataframe coresponding to days 10->20. I cannot find the problem...
import pandas as pd
def select_needed_dates(month_start, day_start, year_start, month_end, day_end, year_end):
data = pd.read_csv("https://raw.githubusercontent.com/iulianastroia/csv_data/master/oct-march.csv")
data['day'] = pd.to_datetime(data['day'])
data = data.loc[(data['day'] >= year_start + "-" + day_start + "-" + month_start) & (
data['day'] <= year_end + "-" + day_end + "-" + month_end)]
print(data)
select_needed_dates("10", "03", "2020", "20", "03", "2020")