<jupyter_start><jupyter_text>Importing covid19 dataset<jupyter_code>corona_dataset_csv = pd.read_csv("covid19_Confirmed_dataset.csv")
corona_dataset_csv.head()
corona_dataset_csv.shape<jupyter_output><empty_output><jupyter_text>Delete the useless columns<jupyter_code>corona_dataset_csv.drop(["Lat","Long"],axis=1,inplace=True)
corona_dataset_csv.head()<jupyter_output><empty_output><jupyter_text>Aggregating the rows by the country<jupyter_code>corona_dataset_aggregated = corona_dataset_csv.groupby("Country/Region").sum()
corona_dataset_aggregated.head()
corona_dataset_aggregated.shape<jupyter_output><empty_output><jupyter_text>Visualizing data related to a country for example Chinavisualization always helps for better understanding of our data.<jupyter_code>corona_dataset_aggregated.loc["China"].plot()
corona_dataset_aggregated.loc["Italy"].plot()
corona_dataset_aggregated.loc["Spain"].plot()
corona_dataset_aggregated.loc["India"].plot()
plt.legend()<jupyter_output><empty_output><jupyter_text>Calculating a good measure we need to find a good measure represented as a number, describing the spread of the virus in a country.<jupyter_code>corona_dataset_aggregated.loc['China'].plot()
corona_dataset_aggregated.loc["China"][:3].plot()<jupyter_output><empty_output><jupyter_text>Calculating the first derivative of the curve<jupyter_code>corona_dataset_aggregated.loc["China"].diff().plot()<jupyter_output><empty_output><jupyter_text>Find maxmimum infection rate for China<jupyter_code>corona_dataset_aggregated.loc["China"].diff().max()
corona_dataset_aggregated.loc["India"].diff().max()<jupyter_output><empty_output><jupyter_text>Find maximum infection rate for all of the countries.<jupyter_code>countries = list(corona_dataset_aggregated.index)
max_infection_rate = []
for c in countries:
    max_infection_rate.append(corona_dataset_aggregated.loc[c].diff().max())
corona_dataset_aggregated["max_infection_rate"]=max_infection_rate
corona_dataset_aggregated<jupyter_output><empty_output><jupyter_text>Create a new dataframe with only needed column<jupyter_code>corona_data = pd.DataFrame(corona_dataset_aggregated["max_infection_rate"])
corona_data.head()<jupyter_output><empty_output><jupyter_text>Importing the WorldHappinessReport.csv dataset<jupyter_code>happiness_report_csv = pd.read_csv("worldwide_happiness_report.csv")
happiness_report_csv<jupyter_output><empty_output><jupyter_text>let's drop the useless columns<jupyter_code>useless_cols=["Overall rank","Score","Generosity","Perceptions of corruption"]
happiness_report_csv.drop(useless_cols,inplace=True,axis=1)
happiness_report_csv<jupyter_output><empty_output><jupyter_text>Changing the indices of the dataframe<jupyter_code>happiness_report_csv.set_index('Country or region', inplace=True)
happiness_report_csv<jupyter_output><empty_output><jupyter_text>Now let's join two dataset we have prepared    Corona Dataset :<jupyter_code>corona_data<jupyter_output><empty_output><jupyter_text>world happiness report Dataset :<jupyter_code>happiness_report_csv
data = corona_data.join(happiness_report_csv,how="inner")
data<jupyter_output><empty_output><jupyter_text>correlation matrix<jupyter_code>data.corr()<jupyter_output><empty_output><jupyter_text>Visualization of the resultsour Analysis is not finished unless we visualize the results in terms figures and graphs so that everyone can understand what you get out of our analysis<jupyter_code>data.head()<jupyter_output><empty_output><jupyter_text>Plotting GDP vs maximum Infection rate<jupyter_code>x= data["GDP per capita"]
y= data["max_infection_rate"]
sns.scatterplot(x,np.log(y))
sns.regplot(x,np.log(y))<jupyter_output><empty_output><jupyter_text>Plotting Social support vs maximum Infection rate<jupyter_code>x= data["Social support"]
y= data["max_infection_rate"]
sns.scatterplot(x,np.log(y))
sns.regplot(x, np.log(y))<jupyter_output><empty_output><jupyter_text>Plotting Healthy life expectancy vs maximum Infection rate<jupyter_code>x= data["Healthy life expectancy"]
y= data["max_infection_rate"]
sns.scatterplot(x,np.log(y))
sns.regplot(x, np.log(y))<jupyter_output><empty_output><jupyter_text>Plotting Freedom to make life choices vs maximum Infection rate<jupyter_code>x= data["Freedom to make life choices"]
y= data["max_infection_rate"]
sns.scatterplot(x,np.log(y))
sns.regplot(x, np.log(y))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11014426379665675, 'fraction_numerical': 0.0016029310739638196, 'mean_word_length': 13.045016077170418, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 81, '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': '20', 'dir': 'jupyter-structured-clean-dedup', 'id': '37486', 'license': 'MIT', 'n_tokens_mistral': 1567, 'n_tokens_neox': 1502, 'n_words': 229, 'path': 'covid19 data analysis notebook.ipynb', 'repo_name': 'shamvy/Covid-19-Data-Analysis', 'size': '4367'}