dateparse = lambda x: pd.datetime.strptime(x, '%m/%d/%Y')
df = pd.read_csv('Sample.csv', index_col='date', parse_dates=[0],
    date_parser=dateparse)
How to find the average of previous sales at each time in python