<jupyter_start><jupyter_text>Full Set Visualizations<jupyter_code># Green energy per year, sized by ideology

fig, ax = plt.subplots(figsize=(10,6))

scatter = ax.scatter(x=data.year, y=data.green_energy, s=data.gov_ideology*2);
ax.set(xlabel='Year', ylabel='Green Energy');

plt.savefig('../app/static/images/green_energy_.png')
# Percent change in green energy production by government ideology
fix,ax=plt.subplots(figsize=(10,6))
scatter = ax.scatter(x=data.perc_change_green, y=data.gov_ideology);

# data.plot.scatter(x='perc_change_green',y='gov_ideology')
ax.set(xlabel='Percent Change in Green Energy Production', ylabel='Government Ideology');

plt.savefig('../app/static/images/green_change_ideology.png')
# Total Green Energy Over Time
data.head()
# Change in Green Energy by Year
green_grouped = data.groupby(data.year)

green_energy = pd.DataFrame(green_grouped.green_energy.sum()).reset_index()
green_energy.head()

fix,ax=plt.subplots(figsize=(10,6))
scatter = ax.scatter(green_energy.year,green_energy.green_energy);
ax.set(xlabel='Year', ylabel='Green Energy Millions of Mwh');

# plt.savefig('../app/static/images/green_change_ideology.png')
# Conv energy total over time
conv_grouped = data.groupby(data.year)

conv_energy = pd.DataFrame(conv_grouped.conventional_energy.sum()).reset_index()
conv_energy.head()

fix,ax=plt.subplots(figsize=(10,6))
scatter = ax.scatter(conv_energy.year,conv_energy.conventional_energy);
ax.set(xlabel='Year', ylabel='Green Energy Millions of Mwh');<jupyter_output><empty_output><jupyter_text>Limited-set Visualizaitons  California<jupyter_code>california_df = data.loc[data["state_id"] == "TX"]
california_df.head()
california_df.plot.scatter(x='gov_ideology',y='green_energy')<jupyter_output><empty_output><jupyter_text>High Population<jupyter_code>population_df = data.loc[data["population"] > 5000000]

population_df.plot.scatter(x='gov_ideology',y='green_energy')<jupyter_output><empty_output><jupyter_text>Select States Visualizations<jupyter_code>combined_states = data.loc[(data["state_id"] == "TX") | (data["state_id"] == "CA") | (data["state_id"] == "OH") | (data["state_id"] == "FL") |  (data["state_id"] == "PA")  ] 
combined_states.head()
combined_states.plot.scatter(x='gov_ideology',y='perc_change_green')<jupyter_output><empty_output><jupyter_text>Population Percent<jupyter_code>population_df_percent_change = data.loc[data["population"] > 5000000]

population_df_percent_change.plot.scatter(x='gov_ideology',y='perc_change_green')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15697904310003954, 'fraction_numerical': 0.010676156583629894, 'mean_word_length': 9.411522633744855, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '370854', 'license': 'MIT', 'n_tokens_mistral': 957, 'n_tokens_neox': 914, 'n_words': 118, 'path': 'Visualizations/.ipynb_checkpoints/Project 3 Calculations-checkpoint.ipynb', 'repo_name': 'Davidtaboh/Energy-Production-in-the-United-States', 'size': '2529'}