Skip to content

Instantly share code, notes, and snippets.

@dottyz
Created May 2, 2019 18:41
Show Gist options
  • Save dottyz/2b32b7c923ce1d1b92cbeddcfd724d34 to your computer and use it in GitHub Desktop.
Save dottyz/2b32b7c923ce1d1b92cbeddcfd724d34 to your computer and use it in GitHub Desktop.
data = df.groupby(['Date', 'Hour', 'User Type'])['Id'].nunique().groupby(['Hour', 'User Type']).mean().reset_index()
fig, ax = plt.subplots(figsize=(16, 9))
sns.barplot(x='Hour', y='Id', hue='User Type', data=data, ax=ax)
ax.set_ylabel('Average Hourly Trips')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment