<jupyter_start><jupyter_text>Polls DatasetDownload data from [https://github.com/fivethirtyeight/data/tree/master/polls](https://github.com/fivethirtyeight/data/tree/master/polls) and place in `"../data/"`<jupyter_code>import os
import sys
import json
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import warnings

warnings.filterwarnings('ignore')
%matplotlib inline
df = pd.read_csv(os.path.join("..","data","polls","president_primary_polls.csv"))
print(json.dumps(list(df.columns), indent=1))
df.head()
fig, ax = plt.subplots(figsize=(12,8))
results = df.loc[df["cycle"]==2020]
results = results.loc[df["stage"]=="primary"]
results = results.loc[df["party"]=="DEM"]
results = results.groupby(by=["candidate_name","created_at"])["pct"].mean()
results = results.unstack(level="candidate_name")
mask = results.mean(axis=0)>7.0
results = results.loc[:, mask]
results.plot(ax=ax)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17827004219409281, 'fraction_numerical': 0.011603375527426161, 'mean_word_length': 7.787037037037037, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '387436', 'license': 'MIT', 'n_tokens_mistral': 346, 'n_tokens_neox': 339, 'n_words': 55, 'path': 'src/polls_dataset.ipynb', 'repo_name': 'berkeley-politics-capstone/politics-capstone', 'size': '948'}