Skip to content

Instantly share code, notes, and snippets.

@dottyz
Created May 2, 2019 18:41
Show Gist options
  • Save dottyz/3231c70db64d01bdb654b8eaab19ba07 to your computer and use it in GitHub Desktop.
Save dottyz/3231c70db64d01bdb654b8eaab19ba07 to your computer and use it in GitHub Desktop.
fig, axes = plt.subplots(1, 3, figsize=(18, 6))
axes = np.array(axes).flatten()
for m, ax in zip(ridership[ridership['Quarter']==3]['Month'].unique(), axes):
ax.set_title(m)
ax.set_ylim(0, 7000)
ax.set_ylabel('Average Daily Trips')
sns.barplot(
x='Day of Week',
y='Id',
hue='User Type',
data=ridership[ridership['Month']==m].groupby(['Day of Week', 'User Type'])['Id'].mean().reset_index(),
ax=ax
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment