import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv('Bakery Sales.csv')
df
df_order_by_total = df.sort_values('total', ascending=False)
x = df_order_by_total['total'][:5]
print(x)
df_order_by_total = df.sort_values('total', ascending=False)
x = df_order_by_total['total'][1:]
plt.hist(x)
plt.show()
df_order_by_total = df.sort_values('total', ascending=False)
x = df_order_by_total['total'][1:]
bins = [i for i in range(12000, 30000, 2500)]
plt.hist(x, bins)
plt.show()
df.groupby('day of week')['total'].mean().sort_values(ascending=False)
df.groupby('day of week')['total'].count().sort_values(ascending=False)
df.groupby('day of week')['total'].sum().sort_values(ascending=False)
df.groupby('hour')['total'].count().sort_values(ascending=False)
month = df['datetime'].str[6:7]
df['month'] = month
df.groupby('month')['total'].sum().sort_values(ascending=False)
df['year'] = df['datetime'].str[:4]
df.groupby('year')['total'].sum().sort_values(ascending=False)
print(df.columns)
df.drop(['place', 'angbutter', 'plain bread',
'jam', 'americano', 'croissant', 'caffe latte', 'tiramisu croissant',
'cacao deep', 'pain au chocolat', 'almond croissant', 'croque monsieur',
'mad garlic', 'milk tea', 'gateau chocolat', 'pandoro', 'cheese cake',
'lemon ade', 'orange pound', 'wiener', 'vanila latte', 'berry ade',
'tiramisu', 'merinque cookies'], axis=1)