import pandas as pd
import matplotlib as plt
df = pd.read_csv('turnstile_180818.txt')
df[:3]
df.iloc[0]
df_temp = df.copy()
list(df)
df_temp = df_temp.rename(columns={'EXITS ': 'EXITS'})
df_subset1 = df_temp[['STATION','DATE','TIME','ENTRIES','EXITS']]
df_subset1[:3]
df_subset1 = df_subset1[df_subset1['STATION'] == '59 ST']
grouped = df_subset1.groupby(['DATE','TIME'])
grouped.sum()
grouped = grouped.sum()
import matplotlib.pyplot as plt
grouped.plot(y = 'ENTRIES')
plt.title('59ST Entries By Date')
plt.xlabel('DATE,TIME')
plt.ylabel('ENTRIES')
df_hist = df_subset1[['DATE', 'ENTRIES', 'EXITS']]
df_hist = df_hist.groupby(['DATE'], as_index = False)
df_hist = df_hist.sum()
df_hist
df_hist.plot(x = 'DATE',kind = 'bar')