<jupyter_start><jupyter_text>Map view / ORganize stations IDs* QGIS  A Free and Open Source Geographic Information System : https://qgis.org/en/site/![DC view of groundstations](map.png)* For openAQ (type AirNow) we have station of same id in several locations, let'add suffixe  * 4 groundstations DC_EPA  * 2 groundstations MA_EPA* For PurpleAir we have 2 measurement with 2 differents groundstations for sensor A and B at the same location  * Cheverly 9 and Cheverly 1  * 13th & E ST SE A  and 13th & E ST SE B   * 14th & S ST NW A  and 14th & S ST NW B<jupyter_code>df.loc[:, 'new_station'] = df['station_id']
df.loc[(df["station_id"] == 'Cheverly 1') | (df["station_id"] == 'Cheverly 9'),'new_station'] = 'Cheverly'
df.loc[(df["station_id"] == '14th & S ST NW B') | (df["station_id"] == '14th & S ST NW A'),'new_station'] = '14th & S ST NW'
df.loc[(df["station_id"] == '13th & E ST SE B') | (df["station_id"] == '13th & E ST SE A'),'new_station'] = '13th & E ST SE'
df.loc[(df["station_id"] == 'DC_EPA') & (np.isclose(df["x"] , 38.875160)) & (np.isclose(df["y"] , -77.012820)), 'new_station'] = 'DC_EPA_1'
df.loc[(df["station_id"] == 'DC_EPA') & (np.isclose(df["x"] , 38.894750)) & (np.isclose(df["y"] , -76.953430)), 'new_station'] = 'DC_EPA_2'
df.loc[(df["station_id"] == 'DC_EPA') & (np.isclose(df["x"] , 38.895683)) & (np.isclose(df["y"] , -76.958090)), 'new_station'] = 'DC_EPA_3'
df.loc[(df["station_id"] == 'DC_EPA') & (np.isclose(df["x"] , 38.921850)) & (np.isclose(df["y"] , -77.013176)), 'new_station'] = 'DC_EPA_4'
df.loc[(np.isclose(df["x"] , 39.055300)) & (np.isclose(df["y"] , -76.878300)), 'new_station'] = 'MA_EPA_1'
df.loc[(np.isclose(df["x"] , 39.114400)) & (np.isclose(df["y"] , -77.106900)), 'new_station'] = 'MA_EPA_2'

df.groupby(['new_station', 'x', 'y'])["pm25"].count()
df["new_station"].value_counts()
#Because we have 2 measure hourly for 13th & E ST SE, 14th & S ST NW and Cheverly lets remove B sensor and keep A sensor

filterA = ~(df['station_id'] == '13th & E ST SE B')
filterB = ~(df['station_id'] == '14th & S ST NW B')
filterC = ~(df['station_id'] == 'Cheverly 9')
df = df[filterA & filterB & filterC]

df.groupby(['station_id', 'new_station', 'sensor', 'x', 'y'])["pm25"].count()
#We drop degree direction because we have the direction using SIN and COS values
df.loc[:, "station_id" ] = df["new_station"]
df.drop(["Wind-Dir", "new_station"], axis = 1) 

df.info()
df["station_id"].value_counts()
df.to_csv("eda.csv", index=False)
df['datetime'] =  pd.to_datetime(df['datetime'])

for station in df["station_id"].unique():
    df[df["station_id"] == station].plot(title = station, subplots=True, y='pm25', x='datetime')<jupyter_output><empty_output><jupyter_text>Looking to cyclic visualizationTIme in the day seems to have influence<jupyter_code>for station in df["station_id"].unique():
    ax = sns.scatterplot(x="cos_day", y="sin_day", hue="pm25",
                        data=df[df["station_id"] == station],
                        size="pm25",
                        sizes=(20, 400),
                       ).set_title(station)
    plt.show()
df[["datetime", "sin_day", "cos_day"]]
ax = sns.scatterplot(x="cos_wind", y="sin_wind", hue="pm25",
                    data=df[df["pm25"] < 100], size="pm25", sizes=(20, 400),
                   ).set_title("WIND dir. All stations (without extremes pm25)")
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20389495426379464, 'fraction_numerical': 0.050752434346414875, 'mean_word_length': 4.424, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 9, 'https://': 1, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '438994', 'license': 'MIT', 'n_tokens_mistral': 1426, 'n_tokens_neox': 1291, 'n_words': 307, 'path': 'model/1.1 - EDA - Stations IDs by locations.ipynb', 'repo_name': 'georgetown-analytics/Air-Pollution', 'size': '3389'}