Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. trip_count_by_month=trip.groupby(['start_Year','start_Month'])['id'].count().reset_index()
  2.  
  3. trace1 = go.Bar(
  4. x=trip_count_by_month.start_Month.astype(str)+'-'+trip_count_by_month.start_Year.astype(str),
  5. y=trip_count_by_month.id,
  6. name='No. of trips',
  7. marker=dict(
  8. color=chosen_colors[0]
  9. )
  10. )
  11.  
  12. data=[trace1]
  13.  
  14. layout = go.Layout(
  15. title='No. of bike trips by month',
  16. xaxis=dict(
  17. title='Month'
  18. ),
  19. yaxis=dict(
  20. title='No. of bike trips'
  21. ),
  22. )
  23.  
  24. figure = go.Figure(data=data, layout=layout)
  25.  
  26. ply.iplot(figure)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement