<jupyter_start><jupyter_text>Fake News On Twitter During the 2016 Presidential Election   Exploratory Data AnalysisWe begin by loading the datasets used in this study.<jupyter_code># To generate the figure 1, we need to load these data set
daily_counts_exposures = pd.read_csv('daily_counts_exposures.csv')
daily_counts_exposures_guess = pd.read_csv('daily_counts_exposures_guess.csv')
daily_counts_shares = pd.read_csv('daily_counts_shares.csv')
display(daily_counts_exposures_guess.head(5))
display(daily_counts_exposures.head(5))
display(daily_counts_shares.head(5))
date = daily_counts_exposures_guess["date"][0]
print(date)
month = date[5:7]
month
def apply_month(date):
    return date[5:7]
daily_counts_exposures_guess.head(5)
# # daily_counts_exposures_guess['month'] = daily_counts_exposures_guess.apply(apply_month, daily_counts_exposures_guess['date'])
# daily_counts_exposures_guess['date'] = daily_counts_exposures_guess['date'].apply(apply_month)
# daily_counts_exposures_guess[['date', 'pct_red', 'pct_orange', 'pct_black', 'pct_fake']].plot('date')
# plt.ylabel("Fake News Sources in Aggregate Political Explosures")
# plt.xlabel("Month")
##
daily_counts_exposures['date'] = daily_counts_exposures['date'].apply(apply_month)
daily_counts_exposures[['date', 'pct_black', 'pct_red','pct_orange',]].plot('date', color = {"black", "red", "orange"})
plt.ylabel("Fake News Sources in Aggregate Political Explosures")
plt.xlabel("Month")
daily_counts_exposures_guess.head()
daily_counts_exposures_guess['date'] = daily_counts_exposures_guess['date'].apply(apply_month)
daily_counts_exposures_guess[['date', 'pct_black', 'pct_red','pct_orange',]].plot('date', color = {"black", "red", "orange"})
plt.ylabel("Fake News Sources in Aggregate Political Explosures")
plt.xlabel("Month")
# daily_counts_shares['date'] = daily_counts_shares['date'].apply(apply_month)
# daily_counts_shares[['date', 'pct_red', 'pct_orange', 'pct_black', 'pct_fake']].plot('date')<jupyter_output><empty_output><jupyter_text>We wish to analyze the relationship between two variables. In this study, we believed that conservative voters engaged with fake news more within the context of this study. WE create a data visualization that examines this relationship graphically. $H_0$: Voters during the 2016 election are most likely to engage with fake news sources were conservative leaning, older, and highly engaged with political news$H_A$: All types of voters during the 2016 election are engaging with fake news at similar frequencies.<jupyter_code>domain_codings = pd.read_csv('Domain Coding Page Four.csv')
display(domain_codings.head(20))
domain_codings.groupby('partisanship')['weighted political alignment'].plot.bar()
plt.ylabel('weighted political alignment')
plt.xlabel('partisanship')<jupyter_output><empty_output><jupyter_text>Average weighted political alignment of websites that recieved exposure during 2016 election season:<jupyter_code>domain_codings['weighted political alignment'].mean()<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup