<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 When /r/The_Donald disabled the downvoting button via CSS
Subreddit disabled comments on 2016-04-15, thread here
Data processing
BigQuery
Step1:  Visualizations
Daily average of number of comments per post
Step2:  Daily average of number of upvotes per post
<ASSISTANT_TASK:>
Python Code:
import pandas as pd
import seaborn as sns
%matplotlib inline
posts_df = pd.DataFrame.from_csv("reddit_posts_the_donald_201604.csv")
posts_df[0:5]
posts_df['created'] = pd.to_datetime(posts_df.created_utc, unit='s')
posts_df['created_date'] = posts_df.created.dt.date
posts_df['downs'] = posts_df.score - posts_df.ups
posts_time_ups = posts_df.set_index('created_date').ups.sort_index()
posts_time_ups[0:5]
posts_date_df = posts_df.set_index('created').sort_index()
posts_date_df[0:5]
posts_groupby = posts_date_df.groupby([pd.TimeGrouper('1D', closed='left')])
Explanation: When /r/The_Donald disabled the downvoting button via CSS
Subreddit disabled comments on 2016-04-15, thread here
Data processing
BigQuery:
SELECT author, num_comments, score, ups, downs, gilded, created_utc FROM [fh-bigquery:reddit_posts.2016_04] 
WHERE subreddit = 'The_Donald'
https://storage.cloud.google.com/staeiou_reddit/reddit_posts_the_donald_201604
End of explanation
posts_groupby.mean().num_comments.plot(kind='barh', figsize=[8,8])
Explanation: Visualizations
Daily average of number of comments per post
End of explanation
posts_groupby.mean().ups.plot(kind='barh', figsize=[8,8])
Explanation: Daily average of number of upvotes per post
End of explanation
<END_TASK>