image_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

uber_data = pd.read_csv('../input/uber-raw-data-janjune-15.csv')

uber_data.shape

Month = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
Index = [0, 1, 2, 3, 4, 5]
Monthly_pickup = uber_data.groupby(['Month']).size()
plt.xticks(Index, Month)

month = ['01', '02', '03', '04', '05', '06']
idx = [0, 7, 14, 21, 27]
def daily_pickup_plot(month):
    plot_data = uber_data[uber_data['Month'] == month]
    plot_data = plot_data.groupby(['Date']).size()
    plt.xticks(idx, plot_data.index[idx])
for i in range(0, 6):
    plt.ylim(0, 140000)

Hourly_pickup = uber_data.groupby(['Hour']).size()
mean = Hourly_pickup.mean()
hour = [i for i in range(0, 24)]
plt.xticks(hour, hour)

def hourly_pickup_plot(month):
    plot_data = uber_data[uber_data['Month'] == month]
    plot_data = plot_data.groupby(['Hour']).size()
    plot_data.plot(kind='bar')
    plt.xlabel('')
    plt.xticks(hour, plot_data.index[hour])
plt.figure(1, figsize=(12, 24))
for i in range(0, 6):
    plt.subplot(3, 2, i + 1)
    hourly_pickup_plot(month[i])
    plt.title('Hourly Pickup of ' + Month[i] + ' 2015')
    plt.xlabel('')
    plt.ylim(0, 200000)