# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# !conda install -c conda-forge selenium 

from IPython.display import HTML
import requests
import pandas as pd
import numpy as np


# +

r = requests.get('https://aqs.epa.gov/data/api/sampleData/byCounty?email=<EMAIL>&key=indigowolf98&param=42101&bdate=20140101&edate=20141231&state=17&county=031')
x = r.json()
x.keys()
df = pd.DataFrame(x['Data'])
print (df)
# -

df.info()

df1 = df.drop(df.columns[[0,1,2,3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,21,22,23,25,26]], axis=1)

df1.info()
df1.head()
df1.to_csv('/Users/kimberlyuribe/Downloads/cmchi.csv', index=False)

df.info()

df = df.drop(df.columns[[1, 4, 5, 6, 8]], axis=1)

df.info()

df = df.drop(df.columns[[4, 5, 6, 7, 9, 11, 12, 14, 15]], axis=1)

df.info()

print (df)
df.to_csv('/Users/kimberlyuribe/Downloads/cmchi.csv', index=False)

# +

r = requests.get('https://aqs.epa.gov/data/api/sampleData/byCounty?email=<EMAIL>&key=indigowolf98&param=42101&bdate=20150101&edate=20151231&state=17&county=031')
x = r.json()
x.keys()
dg = pd.DataFrame(x['Data'])
dg = dg.drop(dg.columns[[0, 1, 2, 3, 5, 6]], axis=1)
dg = dg.drop(dg.columns[[1, 4, 5, 6, 8]], axis=1)
dg = dg.drop(dg.columns[[4, 5, 6, 7, 9, 11, 12, 14, 15]], axis=1)
dg.info()
print (dg)
# -

r = requests.get('https://aqs.epa.gov/data/api/sampleData/byCounty?email=<EMAIL>&key=indigowolf98&param=42101&bdate=20160101&edate=20161231&state=17&county=031')
x = r.json()
x.keys()
dh = pd.DataFrame(x['Data'])
dh = dh.drop(dh.columns[[0, 1, 2, 3, 5, 6]], axis=1)
dh = dh.drop(dh.columns[[1, 4, 5, 6, 8]], axis=1)
dh = dh.drop(dh.columns[[4, 5, 6, 7, 9, 11, 12, 14, 15]], axis=1)
dh.info()
print (dh)
dh.to_csv('/Users/kimberlyuribe/Downloads/cmchi16.csv', index=False)

r = requests.get('https://aqs.epa.gov/data/api/sampleData/byCounty?email=<EMAIL>&key=indigowolf98&param=42101&bdate=20170101&edate=20171231&state=17&county=031')
x = r.json()
x.keys()
dj = pd.DataFrame(x['Data'])
dj = dj.drop(dj.columns[[0, 1, 2, 3, 5, 6]], axis=1)
dj = dj.drop(dj.columns[[1, 4, 5, 6, 8]], axis=1)
dj = dj.drop(dj.columns[[4, 5, 6, 7, 9, 11, 12, 14, 15]], axis=1)
dj.info()
print (dj)
dj.to_csv('/Users/kimberlyuribe/Downloads/cmchi17.csv', index=False)



StarcoderdataJupyterScriptsDedupFiltered