<jupyter_start><jupyter_text>COVID-19 in Maryland  Import Libraries<jupyter_code># for data analysis
import pandas as pd
import numpy as np

# to help export files
from google.colab import files

import plotly.express as px<jupyter_output><empty_output><jupyter_text>Import Data<jupyter_code>#Maryland COVID-19 Confirmed Deaths By Age Distribution
df_age = pd.read_csv("https://raw.githubusercontent.com/matthewprk/covid-19-trends-in-maryland-/main/Data/MD_COVID-19_-_Confirmed_Deaths_by_Age_Distribution.csv")

#Maryland COVID-19 Confirmed Deaths By Gender
df_gender = pd.read_csv("https://raw.githubusercontent.com/matthewprk/covid-19-trends-in-maryland-/main/Data/MD_COVID-19_-_Confirmed_Deaths_by_Gender_Distribution.csv")

#Maryland COVID-19 Confirmed Deaths By Race and Ethnicity
df_race = pd.read_csv("https://raw.githubusercontent.com/matthewprk/covid-19-trends-in-maryland-/main/Data/MD_COVID-19_-_Confirmed_Deaths_by_Race_and_Ethnicity_Distribution.csv")
#Preview

df_age.head()
#Age - Split Text to Columns 

new = df_age["DATE"].str.split("/", n=2, expand = True)
df_age["Month Number"] = new[0]
df_age["Date"] = new[1]
df_age["Year"] = new[2]
df_age.head()
#Age - Information

df_age.info()
#Age Data at End of Each Month

data_age = [['April',0, 0, 8, 14, 26, 68, 161, 251, 444],
            ['May',0, 1, 13, 30, 69, 168, 385, 600, 1102],
            ['June',0, 1, 16, 40, 96, 239, 493, 744, 1408],
            ['July',0, 1, 19, 45, 108, 264, 552, 829, 1534],
            ['August',0, 2, 23, 46, 120, 291, 591, 896, 1641],
            ['September',0, 2, 23, 48, 123, 312, 627, 946, 1722],
            ['October',0, 2, 24, 52, 130, 327, 656, 996, 1811],
            ['November',1, 3, 26, 53, 139, 361, 717, 1126, 2058]]
df_age_endmonth = pd.DataFrame(data_age, columns = ['Month', 'Ages 0-9', 'Ages 10-19', 'Ages 20-29', 'Ages 30-39', 'Ages 40-49', 'Ages 50-59', 'Ages 60-69', 'Ages 70-79', 'Ages 80+'])
df_age_endmonth
#Melt age
df_age_melt = pd.melt(df_age_endmonth, id_vars=["Month"], value_vars=["Ages 0-9", "Ages 10-19","Ages 20-29","Ages 30-39","Ages 40-49","Ages 50-59","Ages 60-69", "Ages 70-79","Ages 80+",])
df_age_melt
#Line graph age
line_age_new = px.line(df_age_melt, 
                          x = "Month", 
                          y = "value",
                          color = "variable",
                          labels = {"variable":"Age", "value":"Cumulative Confirmed Deaths (At End of Each Month)"},
                          title = "Maryland's Cumulative Confirmed COVID-19 Deaths By Age"
                           )


line_age_new
#Gender - Split Text to Columns

new = df_gender["DATE"].str.split("/", n=2, expand = True)
df_gender["Month Number"] = new[0]
df_gender["Date"] = new[1]
df_gender["Year"] = new[2]
df_gender.head()
#Gender Data at End of Each Month 

data_gender = [['April',538, 509],
            ['May',1227, 1184],
            ['June',1567, 1495],
            ['July',1711, 1651],
            ['August',1845, 1767],
            ['September',1944, 1861],
            ['October',2048, 1952],
            ['November',2299, 2187]]
df_gender_endmonth = pd.DataFrame(data_gender, columns = ['Month', 'Male', 'Female'])
df_gender_endmonth
#Melt gender
df_gender_melt = pd.melt(df_gender_endmonth, id_vars=["Month"], value_vars=["Male", "Female"])
df_gender_melt
#Line graph gender
line_gender_new = px.line(df_gender_melt, 
                          x = "Month", 
                          y = "value",
                          color = "variable",
                          labels = {"variable":"Gender", "value":"Cumulative Confirmed Deaths (At End of Each Month)"},
                          title = "Maryland's Cumulative Confirmed COVID-19 Deaths By Gender"
                           )


line_gender_new
#Race - Split Text to Columns

new = df_race["DATE"].str.split("/", n=2, expand = True)
df_race["Month Number"] = new[0]
df_race["Date"] = new[1]
df_race["Year"] = new[2]
df_race.head()
#Race Data at End of Each Month 

data_race = [['April',431, 420, 67, 37, 17],
            ['May',995, 1016, 226, 93, 31],
            ['June',1242, 1295, 340, 120, 34],
            ['July',1375, 1422, 389, 127, 35],
            ['August',1486, 1526,420, 133, 39],
            ['September',1558, 1610, 441, 143, 42],
            ['October',1619, 1719, 455, 146, 45],
            ['November',1750, 1991, 488, 160, 50]]
df_race_endmonth = pd.DataFrame(data_race, columns = ['Month', 'African American', 'White', 'Hispanic', 'Asian', 'Other'])
df_race_endmonth
#Melt race
df_race_melt = pd.melt(df_race_endmonth, id_vars=["Month"], value_vars=["African American", "White", "Hispanic", "Asian", "Other"])
df_race_melt
#Line graph race
line_race_new = px.line(df_race_melt, 
                          x = "Month", 
                          y = "value",
                          color = "variable",
                          labels = {"variable":"Race", "value":"Cumulative Confirmed Deaths (At End of Each Month)"},
                          title = "Maryland's Cumulative Confirmed COVID-19 Deaths By Race"
                           )


line_race_new<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15603666861712503, 'fraction_numerical': 0.08913594694753267, 'mean_word_length': 2.8069784706755754, 'pattern_counts': {'":': 6, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 3, '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': '544112', 'license': 'MIT', 'n_tokens_mistral': 2230, 'n_tokens_neox': 1784, 'n_words': 434, 'path': 'Python_in_Google_Colaboratory.ipynb', 'repo_name': 'Daphne-Tang/Assessing-Vulnerable-Groups-to-COVID-19-in-Maryland', 'size': '5127'}