Advertisement
lamiastella

matplotlib problem?

Jan 20th, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. import pandas as pd
  2. import numpy as np
  3. import matplotlib.pyplot as plt
  4.  
  5. tweets_df = pd.read_csv('valid_tweets.csv')
  6. #print(tweets_df)
  7. print(pd.__version__)
  8. pd.date_range('10/20/2016 1:55', '10/20/2016 3:55',
  9.               freq='5 min', tz='UTC')
  10.  
  11. FIVEMIN = pd.offsets.Minute(5)
  12.  
  13. fig, ax = plt.subplots(figsize=(6, 3.5))
  14.  
  15. ax = (
  16.     pd.read_csv('valid_tweets.csv', parse_dates=['Time'])
  17.         .resample(FIVEMIN, on='Time')
  18.         .count()
  19.         .plot.line(ax=ax)
  20. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement