%matplotlib inline import pandas as pd trajets = pd.read_hdf('../datachallenge/divvy-trips.h5', 'fixed') trajets.tripduration.describe() (trajets.tripduration / 60).describe() trajets.groupby('usertype').count().trip_id.plot(kind='bar') # Une solution alternative trajets.usertype.value_counts().plot(kind='bar') (2014 - trajets.birthyear).describe() trajets.groupby('gender').count().trip_id.plot(kind='pie') trajets.groupby(2014 - trajets.birthyear).count().trip_id.plot() trajets.set_index('starttime', inplace=True, drop=False) trajets['date'] = trajets.index.date trajets['joursemaine'] = trajets.index.weekday trajets['heure'] = trajets.index.hour trajets.groupby('date').mean().tripduration.plot() Par jour de la semaine trajets.groupby('joursemaine').mean().tripduration.plot(kind='bar')