Subreddit disabled downvote button on 2013-01-16, thread here
Google BigQuery
SELECT author, num_comments, score, ups, downs, gilded, created_utc FROM [fh-bigquery:reddit_posts.full_corpus_201509]
where subreddit = 'Games'
AND created_utc BETWEEN 1356998400 AND 1359676800
In [12]:
!ls
In [13]:
!pip install bokeh
import pandas as pd
import seaborn as sns
from bokeh.charts import TimeSeries, output_file, show
%matplotlib inline
In [14]:
posts_df = pd.DataFrame.from_csv("reddit_posts_games_201301.csv")
In [15]:
posts_df[0:5]
Out[15]:
In [16]:
posts_df['created'] = pd.to_datetime(posts_df.created_utc, unit='s')
posts_df['created_date'] = posts_df.created.dt.date
In [17]:
posts_df['downs'] = posts_df.score - posts_df.ups
In [18]:
posts_time_ups = posts_df.set_index('created_date').ups.sort_index()
posts_time_ups[0:5]
Out[18]:
In [19]:
posts_date_df = posts_df.set_index('created').sort_index()
posts_date_df[0:5]
Out[19]:
In [20]:
posts_groupby = posts_date_df.groupby([pd.TimeGrouper('1D', closed='left')])
In [21]:
posts_groupby.mean().num_comments.plot(kind='barh', figsize=[8,8])
Out[21]:
In [22]:
posts_groupby.mean().ups.plot(kind='barh', figsize=[8,8])
Out[22]:
In [ ]:
In [ ]:
In [ ]: