-
-
Save anonymous/dde72c69eec66a94975b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the day of week from each date. Starts with Monday as 0. | |
turnstile_weather['day_week'] = turnstile_weather['DATEn'].map(lambda x: x.weekday()) | |
df_by_day = turnstile_weather.groupby('day_week', as_index=False).sum() | |
label_list = [ '', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] | |
# Plot with day of week relabeled as abreviation | |
gg = ggplot(df_by_day, aes('day_week', 'ENTRIESn_hourly')) + \ | |
geom_bar(stat='identity', fill='red') + \ | |
ggtitle('Rush by day of week') + \ | |
scale_x_discrete(labels=label_list) + \ | |
xlab('Day of week') + \ | |
ylab('Entries') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment