0% found this document useful (0 votes)
4 views6 pages

Assignment 7 Covid 19 .Ipynb - Colab

The document is a Jupyter notebook for an assignment analyzing COVID-19 data using Python libraries such as pandas, numpy, matplotlib, and seaborn. It includes data loading, data visualization tasks like plotting daily confirmed cases, scatter plots for testing versus cases, histograms for daily deaths, and boxplots for monthly death rates. The dataset contains 188 rows and 12 columns, and it is free of missing values.

Uploaded by

vaibhavavinashe4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views6 pages

Assignment 7 Covid 19 .Ipynb - Colab

The document is a Jupyter notebook for an assignment analyzing COVID-19 data using Python libraries such as pandas, numpy, matplotlib, and seaborn. It includes data loading, data visualization tasks like plotting daily confirmed cases, scatter plots for testing versus cases, histograms for daily deaths, and boxplots for monthly death rates. The dataset contains 188 rows and 12 columns, and it is free of missing values.

Uploaded by

vaibhavavinashe4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

4/14/25, 6:36 PM Assignment 7 Covid 19 .

ipynb - Colab

Vaibhav Avinashe
ADT24MGTM0639
Assignment 7

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns

df=pd.read_csv("/content/drive/MyDrive/datasets/day_wise.csv")
df

New New New Deaths / 100 Recovered / 100 Deaths / 100 No. of
Date Confirmed Deaths Recovered Active
cases deaths recovered Cases Cases Recovered countries

2020-
0 555 17 28 510 0 0 0 3.06 5.05 60.71 6
01-22

2020-
1 654 18 30 606 99 1 2 2.75 4.59 60.00 8
01-23

2020-
2 941 26 36 879 287 8 6 2.76 3.83 72.22 9
01-24

2020-
3 1434 42 39 1353 493 16 3 2.93 2.72 107.69 11
01-25

2020-
4 2118 56 52 2010 684 14 13 2.64 2.46 107.69 13
01-26

... ... ... ... ... ... ... ... ... ... ... ... ...

2020-
183 15510481 633506 8710969 6166006 282756 9966 169714 4.08 56.16 7.27 187
07-23

2020-
184 15791645 639650 8939705 6212290 281164 6144 228736 4.05 56.61 7.16 187
07-24

2020-
185 16047190 644517 9158743 6243930 255545 4867 219038 4.02 57.07 7.04 187
07-25

2020-
186 16251796 648621 9293464 6309711 204606 4104 134721 3.99 57.18 6.98 187
07-26

2020-
187 16480485 654036 9468087 6358362 228693 5415 174623 3.97 57.45 6.91 187
07-27

188 rows × 12 columns

https://colab.research.google.com/drive/1pFNp-vZIlqOExElkrY8r-4-UJUyRX4N5#scrollTo=UblAY-gAmRLz&printMode=true 1/6
4/14/25, 6:36 PM Assignment 7 Covid 19 .ipynb - Colab

Next steps: Generate code with df toggle_off View recommended plots New interactive sheet

df.shape

(188, 12)

df.isnull().sum()

Date 0

Confirmed 0

Deaths 0

Recovered 0

Active 0

New cases 0

New deaths 0

New recovered 0

Deaths / 100 Cases 0

Recovered / 100 Cases 0

Deaths / 100 Recovered 0

No. of countries 0

dtype: int64

(QUE 1)Plot daily confirmed cases using a line graph.

plt.figure(figsize=(20,10))
sns.lineplot(x='Date', y='Confirmed', data=df)
plt.title('Daily Confirmed COVID-19 Cases')
plt.xlabel('Date')
plt.ylabel('Number of Cases')
plt.xticks(rotation=45)
plt.show()

https://colab.research.google.com/drive/1pFNp-vZIlqOExElkrY8r-4-UJUyRX4N5#scrollTo=UblAY-gAmRLz&printMode=true 2/6
4/14/25, 6:36 PM Assignment 7 Covid 19 .ipynb - Colab

df2=pd.read_csv("/content/drive/MyDrive/datasets/worldometer_data.csv")

(QUE 2)Use scatter plots to visualize the relationship between testing and cases.

https://colab.research.google.com/drive/1pFNp-vZIlqOExElkrY8r-4-UJUyRX4N5#scrollTo=UblAY-gAmRLz&printMode=true 3/6
4/14/25, 6:36 PM Assignment 7 Covid 19 .ipynb - Colab
plt.figure(figsize=(10,5))
plt.scatter(df2['TotalCases'], df2['TotalTests'])
plt.title('Relationship between Testing and Cases')
plt.xlabel('Number of Cases')
plt.ylabel('Number of Tests')

Text(0, 0.5, 'Number of Tests')

(QUE 3)Show the distribution of daily deaths using histograms.

plt.figure(figsize=(10, 5))
plt.hist(df['Deaths'], bins=30, color='#8B0000', alpha=0.7, edgecolor='white')
plt.title('Distribution of Daily COVID-19 Deaths', fontsize=14)
plt.xlabel('Number of Daily Deaths', fontsize=12)
plt.ylabel('Frequency', fontsize=12)
plt.legend()
plt.grid(axis='y', alpha=0.3)
plt.tight_layout()
plt.show()

https://colab.research.google.com/drive/1pFNp-vZIlqOExElkrY8r-4-UJUyRX4N5#scrollTo=UblAY-gAmRLz&printMode=true 4/6
4/14/25, 6:36 PM Assignment 7 Covid 19 .ipynb - Colab

<ipython-input-11-b2e61ffe5287>:6: UserWarning: No artists with labels found to put in legend. Note that artists whose label start with an underscore ar
plt.legend()

(QUE 4)Create a boxplot for monthly death rates to understand dispersion.

df['Date']=pd.to_datetime(df['Date'])
df['Month']=df['Date'].dt.month
df['Year']=df['Date'].dt.year

plt.figure(figsize=(10, 7))
sns.boxplot(x='Month',y='Deaths',data=df)
plt.title('Monthly COVID-19 Death Rates', fontsize=14)
plt.xlabel('Month', fontsize=12)
plt.ylabel('Number of Deaths', fontsize=12)

https://colab.research.google.com/drive/1pFNp-vZIlqOExElkrY8r-4-UJUyRX4N5#scrollTo=UblAY-gAmRLz&printMode=true 5/6
4/14/25, 6:36 PM Assignment 7 Covid 19 .ipynb - Colab

Text(0, 0.5, 'Number of Deaths')

Start coding or generate with AI.

https://colab.research.google.com/drive/1pFNp-vZIlqOExElkrY8r-4-UJUyRX4N5#scrollTo=UblAY-gAmRLz&printMode=true 6/6

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy