<jupyter_start><jupyter_text>Correlation of COVID-19 cases in the states of Mexico by read-write and not read-write people<jupyter_code>import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns

%matplotlib inline
%reload_ext autoreload
%autoreload 2<jupyter_output><empty_output><jupyter_text>Import COVID-19 cases data<jupyter_code>dfcvcases = pd.read_csv('../Data/week1analyzes.csv')
dfcvcases<jupyter_output><empty_output><jupyter_text>Import read-write data<jupyter_code>dfrw = pd.read_excel('../Data/Educacion_01.xlsx', skiprows = range(0, 3))
dfrw.head()
dfrw.rename(columns={'Entidad federativa': 'state', 'Sabe leer y escribir': 'read_write', 'No sabe leer y escribir': 'not_read_write', 'No especificado': 'not_specified'}, inplace=True)
dfrw.head()
dfrw.query('state != "Estados Unidos Mexicanos"', inplace=True)
dfrw['pct_read_write']=dfrw['read_write']/dfrw['Total']*100
dfrw['pct_not_read_write']=dfrw['not_read_write']/dfrw['Total']*100
dfrw['state']=dfrw['state'].str.upper()
dfrw
dfrw = dfrw.iloc[0:32,:].copy()
dfrw.sort_values(by=['state'], ascending = True, inplace=True)
dfrw.at[9,'state']='DISTRITO FEDERAL'
dfrw.at[5,'state']='COAHUILA'
dfrw.at[15,'state']='MEXICO'
dfrw.at[16,'state']='MICHOACAN'
dfrw.at[30,'state']='VERACRUZ'
dfrw.at[22,'state']='QUERETARO'
dfrw.at[24,'state']='SAN LUIS POTOSI'
dfrw.at[31,'state']='YUCATAN'
dfrw.at[19,'state']='NUEVO LEON'
dfrw.sort_values(by=['state'], ascending = True, inplace=True)
dfrw<jupyter_output><empty_output><jupyter_text>Merge Dataframes (COVID Cases / Read-Write Population)<jupyter_code>dfAll = pd.merge(dfcvcases, dfrw,  on='state')
dfAll.head()<jupyter_output><empty_output><jupyter_text>% Read-Write people vs Cases Rate - Regression Plot<jupyter_code>plt.figure(figsize=(14,10))
sns.regplot(x="pct_read_write", y="cases_rates", data=dfAll) 
sns.set_context('paper', font_scale=2)<jupyter_output><empty_output><jupyter_text>% Read-Write people vs Deaths Rate - Regression Plot<jupyter_code>plt.figure(figsize=(14,10))
sns.regplot(x="pct_read_write", y="deaths_rates", data=dfAll) 
sns.set_context('paper', font_scale=2)<jupyter_output><empty_output><jupyter_text>% Not Read-Write people vs Cases Rate - Regression Plot<jupyter_code>plt.figure(figsize=(14,10))
sns.regplot(x="pct_not_read_write", y="cases_rates", data=dfAll) 
sns.set_context('paper', font_scale=2)<jupyter_output><empty_output><jupyter_text>% Not Read-Write people vs Deaths Rate - Regression Plot<jupyter_code>plt.figure(figsize=(14,10))
sns.regplot(x="pct_not_read_write", y="deaths_rates", data=dfAll) 
sns.set_context('paper', font_scale=2)
dfAll["pct_read_write"].describe()<jupyter_output><empty_output><jupyter_text>% Read-Write, % Not Read-Write, Cases Rate, Deaths Rate - Pairs Plot<jupyter_code>dfpairc=dfAll[["pct_read_write", "pct_not_read_write", "cases_rates", "deaths_rates"]]
plt.figure(figsize=(10,7))
sns.pairplot(dfpairc)
sns.set_context('paper', font_scale=1)<jupyter_output><empty_output><jupyter_text>Descriptive statistics (Read-Write, % Not Read-Write, Cases Rate, Deaths Rate)<jupyter_code>dfAll[['pct_read_write', 'pct_not_read_write', 'cases_rates', 'deaths_rates']].describe()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16480099502487564, 'fraction_numerical': 0.018345771144278607, 'mean_word_length': 10.407801418439716, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, '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': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '177470', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1379, 'n_tokens_neox': 1316, 'n_words': 187, 'path': 'Notebooks/prev/Week2_ReadWrite.ipynb', 'repo_name': 'Angel-VB/enlace2021_av', 'size': '3216'}