<jupyter_start><jupyter_text>Project 1- **Team Members**: <NAME>, <NAME>, <NAME>, <NAME>![](Images/florida_covid19_data.jpg) Data set used:* https://open-fdoh.hub.arcgis.com/datasets/florida-covid19-case-line-data<jupyter_code>import requests
import pandas as pd
import io
import datetime as dt
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import JSON

df = pd.read_csv("Resources/Florida_COVID19_Case_Line_Data_new.csv")

df.head(3)
#Clean dataframe

new_csv_data_df = df[['ObjectId', "County",'Age',"Age_group", "Gender", "Jurisdiction", "Travel_related", "Hospitalized","Case1"]]
new_csv_data_df.head()
#Create new csv

new_csv_data_df.to_csv ("new_covid_dataframe.csv")<jupyter_output><empty_output><jupyter_text>There is no change in hospitalizations since reopening Research Question to Answer:* “There is no change in hospitalizations since reopening.”   Part 1: Six (6) Steps for Hypothesis Testing click to expand   1. Identify- **Populations** (divide Hospitalization data in two groups of data):    1. Prior to opening    2. After opening  * Decide on the **date**:    * May 4th - restaurants opening to 25% capacity    * June  (Miami opening beaches)- Distribution:    * Distribution 2. State the hypotheses- **H0**: There is no change in hospitalizations after Florida has reopened- **H1**: There is a change in hospitalizations after Florida has reopened 3. Characteristics of the comparison distribution- Population means, standard deviations 4. Critical values- p = 0.05- Our hypothesis is nondirectional so our hypothesis test is **two-tailed** 5. Calculate 6. Decide!      Part 2: Visualization<jupyter_code>#Calculate total number of cases 
Total_covid_cases = new_csv_data_df["ObjectId"].nunique()
Total_covid_cases = pd.DataFrame({"Total Number of Cases": [Total_covid_cases]})
Total_covid_cases
#Total number of cases per county
total_cases_county = new_csv_data_df.groupby(by="County").count().reset_index().loc[:,["County","Case1"]]
total_cases_county.rename(columns={"County": "County", "Case1": "Total Cases"})
#Total number of cases per county sorted
total_cases_county = total_cases_county.sort_values('Case1',ascending=False)
total_cases_county.head(20)
#Create bar chart for total cases per county
total_cases_county.plot(kind='bar',x='County',y='Case1', title ="Total Cases per County", figsize=(15, 10), color="blue")

plt.title("Total Cases per County")
plt.xlabel("County")
plt.ylabel("Number of Cases")
plt.legend(["Number of Cases"])
plt.show()
#Calculate top 10 counties with total cases
top10_county_cases = total_cases_county.sort_values(by="Case1",ascending=False).head(10)
top10_county_cases["Rank"] = np.arange(1,11)
top10_county_cases.set_index("Rank").style.format({"Case1":"{:,}"})
#Create bar chart for total cases for top 10 counties
top10_county_cases.plot(kind='bar',x='County',y='Case1', title ="Total Cases for Top 10 Counties", figsize=(15, 10), color="blue")

plt.title("Total Hospitalizations for Top 10 Counties")
plt.xlabel("County")
plt.ylabel("Number of Cases")
plt.legend(["Number of Cases"])
plt.show()
#Total number of cases by gender
total_cases_gender = new_csv_data_df.groupby(by="Gender").count().reset_index().loc[:,["Gender","Case1"]]
total_cases_gender.rename(columns={"Gender": "Gender", "Case1": "Total Cases"})
#Create pie chart for total number of cases by gender
total_cases_gender = new_csv_data_df["Gender"].value_counts()

colors=["pink", "blue", "green"]

explode=[0.1,0.1,0.1]

total_cases_gender.plot.pie(explode=explode,colors=colors, autopct="%1.1f%%", shadow=True, subplots=True, startangle=120);

plt.title("Total Number of Cases in Males vs. Females")
#Filter data to show only cases that include hospitalization
filt = new_csv_data_df["Hospitalized"] == "YES"
df = new_csv_data_df[filt]
df
#Calculate total number of hospitalizations
pd.DataFrame({
    "Total Hospitalizations (Florida)" : [df.shape[0]]
}).style.format("{:,}")
#Total number of hospitalization for all counties
hospitalizations_county = df.groupby(by="County").count().reset_index().loc[:,["County","Hospitalized"]]
hospitalizations_county 
#Total number of hospitalization for all counties sorted
hospitalizations_county = hospitalizations_county.sort_values('Hospitalized',ascending=False)
hospitalizations_county.head(10)
#Create bar chart for total hospitalizations per county
hospitalizations_county.plot(kind='bar',x='County',y='Hospitalized', title ="Total Hospitalizations per County", figsize=(15, 10), color="blue")

plt.title("Total Hospitalizations per County")
plt.xlabel("County")
plt.ylabel("Number of Hospitalizations")
plt.show()
#Calculate top 10 counties with hospitalizations
top10_county = hospitalizations_county.sort_values(by="Hospitalized",ascending=False).head(10)
top10_county["Rank"] = np.arange(1,11)
top10_county.set_index("Rank").style.format({"Hospitalized":"{:,}"})
#Create a bar chart for the top 10 counties with hospitalizations
top10_county.plot(kind='bar',x='County',y='Hospitalized', title ="Total Hospitalizations for the Top 10 Counties", figsize=(15, 10), color="blue")

plt.title("Total Hospitalizations for the Top 10 Counties")
plt.xlabel("County")
plt.ylabel("Number of Hospitalizations")
plt.show()
#Average number of hospitalization by county (Not done yet) (Kelsey)
average = hospitalizations_county["Hospitalized"].mean()
average
#Filter data to show only cases that include hospitalization
filt = new_csv_data_df["Hospitalized"] == "YES"
df = new_csv_data_df[filt]
df
#Percentage of hospitalization by gender # Create Visualization (Libardo)
#code on starter_notebook.ipynb

new_csv_data_df
import seaborn as sns
new_csv_data_df['Count']=np.where(new_csv_data_df['Hospitalized']=='YES', 1,0)
new_csv_data_df.head()
new_csv_data_df['Count2']=1
new_csv_data_df['Case1']=pd.to_datetime(new_csv_data_df['Case1'])
case_plot_df=pd.DataFrame(new_csv_data_df.groupby(['Hospitalized', pd.Grouper(key='Case1', freq='W')])['Count2'].count())
case_plot_df.reset_index(inplace=True)
plt.subplots(figsize=[15,7])
sns.lineplot(x='Case1', y='Count2', data=case_plot_df, hue='Hospitalized')
plt.xticks(rotation=45)
#Percentage of hospitalization by age group (Chika) #Create visualization
#Hospitalization by case date/month (needs more) (Libardo) 

#Compare travel-related hospitalization to non-travelrelated cases (Not done yet) (Chika)
#Divide hospitalization data in two groups of data prior to reopening and create new dataframe (Kurt) consider total (Chika)
#Divide hospitalization data in two groups of data after reopening and create new dataframe (Kurt) condider total (Chika)
#Percentage of hospitalization before shut down (Not done yet) (Rephrase) (Chika)
#Percentage of hospitalization during shut down (backburner)
#Percentage of hospitalization after reopening(Not done yet) (Rephrase) (Chika)
#Statistical testing between before and after reopening<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12796757382744645, 'fraction_numerical': 0.01823972206137811, 'mean_word_length': 7.561338289962825, 'pattern_counts': {'":': 7, '<': 13, '<?xml version=': 0, '>': 13, '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': '8962', 'license': 'MIT', 'n_tokens_mistral': 2368, 'n_tokens_neox': 2166, 'n_words': 605, 'path': 'Images/organized_notebook.ipynb', 'repo_name': 'klw11j/covid-19-project', 'size': '6937'}