<jupyter_start><jupyter_text>EDA for Medicare chronic conditions data Link to the Medicare chronic conditions webpage [here](https://www.cms.gov/Research-Statistics-Data-and-Systems/Statistics-Trends-and-Reports/Chronic-Conditions/CC_Main)<jupyter_code>import numpy as np
import scipy as sp
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import matplotlib.cbook as cbook
# load data
def loadChronicSheet(sheet_name):
    orig_data = pd.read_excel("../data/County_Table_Chronic_Conditions_Prevalence_by_Age_2017.xlsx",
                              sheet_name = sheet_name,
                              skiprows = 5,
                              na_values = ["* ", "*", "  "])
    orig_data.columns = ["State", "County", "countyFIPS", "Alcohol Abuse", "Alzheimers", 
                         "Arthritis", "Asthma", "Atrial Fibrillation", "Autism", "Cancer",
                         "Kidney Disease", "COPD", "Depression", "Diabetes", "Drug Abuse",
                         "HIV/AIDS", "Heart Failure", "Hepatitis", "Hyperlipidemia", 
                         "Hypertension", "Ischemic Heart Disease", "Osteoporosis", 
                         "Psychotic Disorders", "Stroke"]
    orig_data.columns = list(orig_data.columns[:3]) + ["condition_" + name for name in orig_data.columns[3:]]
    orig_data = orig_data.dropna(subset = ["County"])
    return orig_data

chronic_young_orig = loadChronicSheet("Beneficiaries Less than 65 Year")
chronic_old_orig = loadChronicSheet("Beneficiaries 65 Years and Over")
chronic_all_orig = loadChronicSheet("All Beneficiaries")
#visualize the top 5 rows
chronic_old_orig.head(5)
# visualize the number of columns and rows
chronic_all_orig.shape
# countyFIPS is a unique id
chronic_all_orig["countyFIPS"].nunique()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10940076965365586, 'fraction_numerical': 0.007146783947223749, 'mean_word_length': 3.292452830188679, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '464055', 'license': 'MIT', 'n_tokens_mistral': 603, 'n_tokens_neox': 544, 'n_words': 129, 'path': 'eda/eda_chronic/01_EDA_chronic.ipynb', 'repo_name': 'rlbarter/covid19-severity-prediction', 'size': '1819'}