Coronavirus
Coronaviruses are a group of related RNA viruses that cause diseases in mammals and birds. In humans, these viruses cause respiratory tract infections that can range from mild to lethal. Mild illnesses include some cases of the common cold (which is caused also by certain other viruses, predominantly rhinoviruses), while more lethal varieties can cause SARS, MERS, and COVID-19.This virus originated from Wuhan city of China.
Technology
- With the help of technology, we can predict how many cases can increase in the coming days.
-
We can create web applications with the help of which people can predict how much they have got the virus.
-
You can see a good visualization of how many cases are in which area. And many more , thus how technology is helping to cure coronavirus.
Practical Implementation
Importing Libraries
#importing required libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import random
import math
import time
from sklearn.model_selection import RandomizedSearchCV , train_test_split
import datetime
import operator
plt.style.use("seaborn")
%matplotlib inline
|
Note
Here we just imported some libraries , pandas- for tabular data manipulation , Numpy to handle array type structure and calculative part in python and matplotlib to handle graphs and visualization part of data.
Reading Data-Set
Note
We have three different datasets here. For confirmed cases, for recovered cases and for total deaths. (The data consist worldwide situation).
You can download datasets from keggle (click here).This datasets is not latest data it is just for learning purpose.Here you will get a zip file by clicking on the download and you can extract required data form the zip file.
#Reading coronavirus confirmed cases across the world
confirmed_cases=pd.read_csv("time_series_covid_19_confirmed.csv")
confirmed_cases.head()
|
Output
Note
- It is just small sanpshot of output if you want to see fi
#Reading coronavirus deaths reported across the world
deaths_reported=pd.read_csv("time_series_covid_19_deaths.csv")
deaths_reported.head()
|
Output
Note
#Reading coronavirus recovered cases across the world
recovered_cases=pd.read_csv("time_series_covid_19_recovered.csv")
recovered_cases.head()
|
Output
cols= confirmed_cases.keys()
cols
|
Output
Note
confirmed= confirmed_cases.loc[:, cols[4]:cols[-1]]
confirmed
|
Note
recovered= recovered_cases.loc[:, cols[4]:cols[-1]]
recovered
|
Note
deaths= deaths_reported.loc[:, cols[4]:cols[-1]]
deaths
|
Note
dates= confirmed.keys()
dates
world_cases=[]
total_deaths=[]
mortality_rate=[]
total_recovered=[]
for i in dates:
confirmed_sum=confirmed[i].sum()
print(confirmed[i])
death_sum=deaths[i].sum()
recovered_sum=recovered[i].sum()
world_cases.append(confirmed_sum)
total_deaths.append(death_sum)
mortality_rate.append(death_sum/confirmed_sum)
total_recovered.append(recovered_sum)
|
Note
print(confirmed_sum)
print(death_sum)
print(recovered_sum)
print(world_cases)
#print(mortality_rate)
|
Note
Develop Projects Like This