Skip to content

Instantly share code, notes, and snippets.

@kurasaiteja
Last active May 28, 2020 21:17
Show Gist options
  • Save kurasaiteja/cf57eb0cf20745ab42776b0765cc52c2 to your computer and use it in GitHub Desktop.
Save kurasaiteja/cf57eb0cf20745ab42776b0765cc52c2 to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
# Average of python column by day
mean_python = df_tweet['python'].resample('1 min').mean()
# Average of js column by day
mean_js = df_tweet['js'].resample('1 min').mean()
# Plot mean python/js by day
plt.plot(mean_python.index.minute, mean_python, color = 'green')
plt.plot(mean_js.index.minute, mean_js, color = 'blue')
# Add labels and show
plt.xlabel('Minute'); plt.ylabel('Frequency')
plt.title('Language mentions over time')
plt.legend(('#python', '#js'))
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment