-
-
Save gumdropsteve/b3e9dde7584a53facb472774c4570688 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
# convert ds to datetime and average trip distance to float | |
df['ds'] = pd.to_datetime(df['ds']) | |
df['avg_trip_distance'] = df['avg_trip_distance'].astype('float') | |
# remove erroneous averages | |
df = df.loc[df['avg_trip_distance'] < 5] | |
# relabel average trip distance as y | |
df = df.rename(columns={'avg_trip_distance' : 'y'}) | |
# plot the average trip distance by day | |
df.plot(x='ds', y='y', figsize=(16, 4), title='Average Trip Distance (Miles) - NYC Yellow Cab', ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment