<jupyter_start><jupyter_text>Exploratory Data Analysis<jupyter_code>import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns<jupyter_output><empty_output><jupyter_text>Read in the Data<jupyter_code>lax_2019 = pd.read_csv('datasets/air-quality-reports/2019/los-angeles-county-aqi2019-date-cleaned.csv')
lax_2020 = pd.read_csv('datasets/air-quality-reports/2020/los-angeles-county-aqi2020-date-cleaned.csv')
traffic = pd.read_csv('datasets/traffic/la_data.csv')
traffic.head()<jupyter_output><empty_output><jupyter_text>Create weekly averagesNote: this was before we had the time series lesson so these methods aren't preferred, and are only used for this notebooks. Other notebooks use preferred methods<jupyter_code>weekly_average_2019 = []
for i in range(0, 365, 7):
    weekly_average_2019.append(lax_2019.iloc[i:i+6]['Overall AQI Value'].mean())
weekly_average_2020= []
for i in range(0, 365, 7):
    weekly_average_2020.append(lax_2020.iloc[i:i+6]['Overall AQI Value'].mean())
aqi_diff = np.array(weekly_average_2019)-np.array(weekly_average_2020)
traffic.shape
traffic.iloc[365:365+365]
weekly_traffic = []
for i in range(365, 365+365, 7):
    weekly_traffic.append(traffic.iloc[i:i+6]['Number of Trips'].mean())
max(weekly_traffic)<jupyter_output><empty_output><jupyter_text>Visualize the Data<jupyter_code>plt.plot(aqi_diff)
plt.plot(weekly_traffic/(max(weekly_traffic)-min(weekly_traffic))*100)
plt.plot(traffic['Number of Trips'].iloc[365:365*2])
plt.plot(weekly_traffic)
plt.ylabel('Number of Trips')
plt.xlabel('Week')
plt.title('Average weekly number of trips for Los Angeles County, 2020')
population = []
for i in range(365, 365+365, 7):
    population.append(traffic.iloc[i:i+6]['Population Staying at Home'].mean())
plt.plot(population)
plt.plot(weekly_traffic)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13402061855670103, 'fraction_numerical': 0.061313076505697235, 'mean_word_length': 7.780952380952381, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '472399', 'license': 'CC0-1.0', 'n_tokens_mistral': 797, 'n_tokens_neox': 682, 'n_words': 123, 'path': 'EDA.ipynb', 'repo_name': 'transcriptive/covid-aqi', 'size': '1843'}