SHARE
TWEET

Untitled

a guest Oct 17th, 2019 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. data = []
  2. ages = ["Pre-K", "Grade School", "Teens", "Young Adults", "Over 30", "Seniors"]
  3.  
  4. top_5 = []
  5. for i in range(5):
  6.     scores = []
  7.     for age in ages:
  8.         scores.append(tuple(rides.sort_values(age, ascending=False)[[age, "Ride"]].iloc[i].values))
  9.     top_5.append(scores)
  10.  
  11. for scores in top_5:
  12. #     bar = go.Bar(showlegend=False, text=["{}: {}".format(x[1], x[0]) for x in scores], textposition="auto", x=ages, y=[x[0] for x in scores])
  13.     bar = go.Bar(showlegend=False, text=[x[1] for x in scores], textposition="auto", x=ages, y=[x[0] for x in scores])
  14.  
  15.     data.append(bar)
  16.  
  17.  
  18. fig = go.Figure(data=data)
  19. # Change the bar mode
  20. fig.update_layout(barmode='group', width=1400)
  21. fig.show()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top