<jupyter_start><jupyter_text>What is Coronavirus2019 Novel Coronavirus (2019-nCoV) is a virus (more specifically, a coronavirus) identified as the cause of an outbreak of respiratory illness first detected in Wuhan, China. Early on, many of the patients in the outbreak in Wuhan, China reportedly had some link to a large seafood and animal market, suggesting animal-to-person spread. However, a growing number of patients reportedly have not had exposure to animal markets, indicating person-to-person spread is occurring. At this time, it’s unclear how easily or sustainably this virus is spreading between people - CDCThis dataset has daily level information on the number of affected cases, deaths and recovery from 2019 novel coronavirus.The data is available from 22 Jan 2020.  Define the ProblemCoronaviruses are a large family of viruses that are common in many different species of animals, including camels, cattle, cats, and bats. Rarely, animal coronaviruses can infect people and then spread between people such as with MERS, SARS, and now with 2019-nCoV.Outbreaks of novel virus infections among people are always of public health concern. The risk from these outbreaks depends on characteristics of the virus, including whether and how well it spreads between people, the severity of resulting illness, and the medical or other measures available to control the impact of the virus (for example, vaccine or treatment medications).This is a very serious public health threat. The fact that this virus has caused severe illness and sustained person-to-person spread in China is concerning, but it’s unclear how the situation in the United States will unfold at this time.The risk to individuals is dependent on exposure. At this time, some people will have an increased risk of infection, for example healthcare workers caring for 2019-nCoV patients and other close contacts. For the general American public, who are unlikely to be exposed to this virus, the immediate health risk from 2019-nCoV is considered low. The goal of the ongoing U.S. public health response is to prevent sustained spread of 2019-nCov in this country.  PrecautionsHealth authorities and scientists say the same precautions against other viral illnesses can be used: wash your hands frequently, cover up your coughs, try not to touch your face. And anyone who does come down with the virus should be placed in isolation. "Considering that substantial numbers of patients with SARS and MERS were infected in health-care settings", precautions need to be taken to prevent that happening again, the Chinese team warned in The Lancet.  Coronovirus Exploratory Data AnalysisWe can explore the analysis of the corono virus affected stats<jupyter_code>%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np<jupyter_output><empty_output><jupyter_text>The data source is from https://www.kaggle.com/sudalairajkumar/novel-corona-virus-2019-dataset<jupyter_code>nCov_df = pd.read_csv('2019_nCoV_data.csv')
nCov_df.columns<jupyter_output><empty_output><jupyter_text>Column Description2019_ncov_data.csvSno - Serial number Date - Date and time of the observation in MM/DD/YYYY HH:MM:SSProvince / State - Province or state of the observation (Could be empty when missing)Country - Country of observationLast Update - Time in UTC at which the row is updated for the given province or country. (Not standardised currently. So please clean them before using it)Confirmed - Number of confirmed casesDeaths - Number of deathsRecovered - Number of recovered casesThe sample data are given below<jupyter_code>nCov_df.head()
nCov_df.info()<jupyter_output><class 'pandas.core.frame.DataFrame'>
RangeIndex: 1199 entries, 0 to 1198
Data columns (total 8 columns):
Sno               1199 non-null int64
Date              1199 non-null object
Province/State    888 non-null object
Country           1199 non-null object
Last Update       1199 non-null object
Confirmed         1199 non-null float64
Deaths            1199 non-null float64
Recovered         1199 non-null float64
dtypes: float64(3), int64(1), object(4)
memory usage: 75.0+ KB<jupyter_text>Based on the above information ,The Province/State having some missing values<jupyter_code>nCov_df.describe()
nCov_df[['Confirmed', 'Deaths', 'Recovered']].sum().plot(kind='bar')<jupyter_output><empty_output><jupyter_text>Observations1. The dataset is contains many countries like China, Japan, US, India and so on.2. The comparision of confirmed with Recovered, It clearly states that the recovery action from virsu is dead slow.3. The data clearly indicating the spreadness of virus is so fast with out any control<jupyter_code>nCov_df.columns<jupyter_output><empty_output><jupyter_text>Data Clean up<jupyter_code>nCov_df.info()<jupyter_output><class 'pandas.core.frame.DataFrame'>
RangeIndex: 1199 entries, 0 to 1198
Data columns (total 8 columns):
Sno               1199 non-null int64
Date              1199 non-null object
Province/State    888 non-null object
Country           1199 non-null object
Last Update       1199 non-null object
Confirmed         1199 non-null float64
Deaths            1199 non-null float64
Recovered         1199 non-null float64
dtypes: float64(3), int64(1), object(4)
memory usage: 75.0+ KB<jupyter_text>Removing the unwanted columns from tha data<jupyter_code>nCov_df.drop(['Sno', 'Last Update'], axis=1, inplace=True)
nCov_df.columns<jupyter_output><empty_output><jupyter_text>Converted the date data type object into datetime<jupyter_code>nCov_df['Date'] = nCov_df['Date'].apply(pd.to_datetime)
nCov_df.info()
nCov_df['Date'].head()
nCov_df[nCov_df['Province/State'] == 'Hong Kong']<jupyter_output><empty_output><jupyter_text>Replacing the wrongly mapped country value towards states<jupyter_code>nCov_df[nCov_df['Province/State'] == 'Taiwan']['Country'] = 'Taiwan'
nCov_df[nCov_df['Province/State'] == 'Hong Kong']['Country'] = 'Hong Kong'
nCov_df['Country'].unique()
nCov_df.replace({'Country': 'Mainland China'}, 'China', inplace=True)<jupyter_output><empty_output><jupyter_text>Listing all the countries which is affected with corono virus<jupyter_code>nCov_df['Country'].unique()<jupyter_output><empty_output><jupyter_text>Country based virus affected people information<jupyter_code>nCov_df.columns
nCov_df.groupby(['Country']).Confirmed.count().reset_index().sort_values(['Country'], ascending = True)<jupyter_output><empty_output><jupyter_text>Top most Severely affected countries<jupyter_code>nCov_df.groupby(['Country']).Confirmed.count().reset_index().sort_values(['Confirmed'], ascending=False).head(10)<jupyter_output><empty_output><jupyter_text>List all the Provinces/States that were affected with Virus<jupyter_code>nCov_df.columns
nCov_df['Province/State'].unique()<jupyter_output><empty_output><jupyter_text>Impact in india<jupyter_code>nCov_df[nCov_df.Country == 'India']<jupyter_output><empty_output><jupyter_text>Exploratory Analysis  Country most affected<jupyter_code>nCov_df.groupby(['Country']).Confirmed.max().reset_index().sort_values(['Confirmed'], ascending=False).head(20).plot(x='Country',
                                                                                                                      kind='bar', figsize=(12,6))<jupyter_output><empty_output><jupyter_text>Country most recovered<jupyter_code>nCov_df.groupby(['Country']).Recovered.max().reset_index().sort_values(['Recovered'], ascending=False).head(20).plot(x='Country',
                                                                                                                      kind='bar', figsize=(12,6))<jupyter_output><empty_output><jupyter_text>Country faced more deaths over the world<jupyter_code>nCov_df.groupby(['Country']).Deaths.max().reset_index().sort_values(['Deaths'], ascending=False).head(20).plot(x='Country',
                                                                                                                      kind='bar', figsize=(12,6))<jupyter_output><empty_output><jupyter_text>Recovery vs Deaths in world wide<jupyter_code>nCov_df[['Country', 'Deaths', 'Recovered']].groupby('Country').max().plot(kind='bar', figsize=(12, 7))<jupyter_output><empty_output><jupyter_text>Recovery vs Deaths in world wide other than China<jupyter_code>nCov_df[nCov_df['Country'] != 'China'][['Country', 'Deaths', 'Recovered']].groupby('Country').max().plot(kind='bar', figsize=(12, 7))
nCov_df['Country'].unique()<jupyter_output><empty_output><jupyter_text>Philippines clearly show that the no recovered happen<jupyter_code>nCov_df[nCov_df['Country'] == 'Philippines'][['Country', 'Confirmed', 'Deaths', 'Recovered']].groupby('Country').max().plot(kind='bar')<jupyter_output><empty_output><jupyter_text>When did Virus Confirmed initially?<jupyter_code>nCov_df['Date'].min()<jupyter_output><empty_output><jupyter_text>When was the Virus Confirmed recently?<jupyter_code>nCov_df['Date'].max()<jupyter_output><empty_output><jupyter_text>How many total no.of persons were identified with Virus on each day<jupyter_code>nCov_df.groupby('Date')[['Confirmed', 'Deaths', 'Recovered']].max().reset_index()<jupyter_output><empty_output><jupyter_text>Case confirmed for each countries<jupyter_code>nCov_df.groupby(['Country']).Confirmed.max().reset_index().plot(x='Country', kind='bar', figsize=(10,6))<jupyter_output><empty_output><jupyter_text>Case confirmed other than China<jupyter_code>nCov_df[nCov_df['Country'] != 'China'].groupby(['Country']).Confirmed.max().reset_index().plot(x='Country', kind='bar', figsize=(10,6))<jupyter_output><empty_output><jupyter_text>The virus spreadness over the confirmed, Deaths and Recovered in globally<jupyter_code>nCov_df.groupby('Date')[['Confirmed', 'Deaths', 'Recovered']].max().reset_index().plot(x='Date',
                                                                                      y=['Confirmed', 'Deaths', 'Recovered'],
                                                                                      figsize=(12, 7))<jupyter_output><empty_output><jupyter_text>Spreadness of virus , Deaths and recovery data other than China<jupyter_code>nCov_df[nCov_df['Country'] != 'China'].groupby('Date')[['Confirmed', 'Deaths', 'Recovered']].max().reset_index().plot(x='Date',
                                                                                      y=['Confirmed', 'Deaths', 'Recovered'],
                                                                                      figsize=(12, 7))<jupyter_output><empty_output><jupyter_text>List the States in China which were affected<jupyter_code>nCov_df.columns
nCov_df[nCov_df['Country'] == 'China'].groupby('Province/State')[['Confirmed']].count().reset_index().plot(x='Province/State',
                                                                                      y=['Confirmed'],kind='bar',
                                                                                      figsize=(12, 7))

nCov_df[nCov_df.Country == 'China'][['Province/State', 'Deaths', 'Recovered']].groupby('Province/State').max().plot(kind='bar',
                                                                                                                   figsize=(12, 7))
nCov_df[nCov_df['Country'] == 'China'].groupby('Province/State')[['Confirmed', 'Deaths', 'Recovered']].max().reset_index().plot(x='Province/State',
                                                                                      y=['Confirmed', 'Deaths', 'Recovered'],
                                                                                      figsize=(12, 7))

nCov_df.columns<jupyter_output><empty_output><jupyter_text>Countries those have worst recovery services<jupyter_code>nCov_df[nCov_df['Recovered'] < nCov_df['Deaths']][['Country', 'Confirmed', 'Deaths', 'Recovered']].groupby('Country').max().plot(kind='bar')<jupyter_output><empty_output><jupyter_text>Countries death rate high and 0 recovery rate<jupyter_code>nCov_df[(nCov_df['Recovered'] < nCov_df['Deaths'])&(nCov_df['Country'] != 'China')][['Country', 'Confirmed', 'Deaths', 'Recovered']].groupby('Country').max().plot(kind='bar',
figsize=(12,7))
nCov_df[(nCov_df['Recovered'] == 0 )&( nCov_df['Deaths'] != 0)][['Country', 'Confirmed', 'Deaths', 'Recovered']].groupby('Country').max().plot(kind='bar')<jupyter_output><empty_output><jupyter_text>Very slow recovery in china<jupyter_code>nCov_df[(nCov_df['Country'] == 'China') & (nCov_df['Recovered'] == 0 )&( nCov_df['Deaths'] != 0)][['Province/State', 'Confirmed', 'Deaths', 'Recovered']].groupby('Province/State').max().plot(kind='bar',
figsize=(12, 7))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11629934992865071, 'fraction_numerical': 0.01767876962105597, 'mean_word_length': 4.019896538002388, 'pattern_counts': {'":': 0, '<': 127, '<?xml version=': 0, '>': 125, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 52, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '31', 'dir': 'jupyter-structured-clean-dedup', 'id': '458679', 'license': 'Apache-2.0', 'n_tokens_mistral': 3910, 'n_tokens_neox': 3648, 'n_words': 948, 'path': 'Coronovirus_Data_Analysis.ipynb', 'repo_name': 'RamaKavanan/Corono_Virus_Analysis', 'size': '12614'}