Using USAGE_PLOT is easy to do but I want to do and learn how to use hist. the same way it is in the image below in which it was used
usage_plot(trip_data, 'duration', ['duration < 60'], boundary = 0, bin_width = 5)
ButI'mtryingseveraldifferentthingsandI'mnotgettingthesameresult:
plt.figure()trip_data_ex=trip_data[trip_data['duration']<60]data_plot_ex=trip_datadata_plot_ex['count']=1data_plot_ex=trip_data_ex.groupby('duration',as_index=False).count()x_data=trip_data_ex['duration'].unique()min_value=data_plot_ex['duration'].min()bins=[i*5+min_value-1foriinrange(13)]plt.hist(data_plot_ex['count'],bins,width=4.9)plt.show()
Any idea how to get on the first image? Thanks for the help.