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

Project Output

The document contains a Python script that analyzes a COVID-19 vaccination dataset using pandas and matplotlib. It provides insights into the number of first and second doses administered state-wise in India, as well as the total number of males and females vaccinated. The script includes data cleaning, aggregation, and visualization of the vaccination data.
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)
3 views6 pages

Project Output

The document contains a Python script that analyzes a COVID-19 vaccination dataset using pandas and matplotlib. It provides insights into the number of first and second doses administered state-wise in India, as well as the total number of males and females vaccinated. The script includes data cleaning, aggregation, and visualization of the vaccination data.
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

import pandas as pd

import [Link] as plt

df = pd.read_csv('covid_vaccine_statewise.csv')

#A)Describe the dataser

[Link]()

Female
Updated Total Doses First Dose Second Dose Male (Doses
State Sessions Sites (Doses
On Administered Administered Administered Administered)
Administered)

0 16/01/2021 India 48276.0 3455.0 2957.0 48276.0 0.0 NaN NaN

1 17/01/2021 India 58604.0 8532.0 4954.0 58604.0 0.0 NaN NaN

2 18/01/2021 India 99449.0 13611.0 6583.0 99449.0 0.0 NaN NaN

3 19/01/2021 India 195525.0 17855.0 7951.0 195525.0 0.0 NaN NaN

4 20/01/2021 India 251280.0 25472.0 10504.0 251280.0 0.0 NaN NaN

[Link]()

Femal
Updated Total Doses First Dose Second Dose Male (Doses
State Sessions Sites (Dose
On Administered Administered Administered Administered)
Administered

West
7840 11/08/2021 NaN NaN NaN NaN NaN NaN Na

West
7841 12/08/2021 NaN NaN NaN NaN NaN NaN Na

West
7842 13/08/2021 NaN NaN NaN NaN NaN NaN Na

West
7843 14/08/2021 NaN NaN NaN NaN NaN NaN Na

West
7844 15/08/2021 NaN NaN NaN NaN NaN NaN Na

[Link]()
<class '[Link]'>
RangeIndex: 7845 entries, 0 to 7844
Data columns (total 24 columns):
# Column Non-Null Count Dtype

0 Updated On 7845 non-null object


1 State 7845 non-null object
2 Total Doses Administered 7621 non-null float64
3 Sessions 7621 non-null float64
4 Sites 7621 non-null float64
5 First Dose Administered 7621 non-null float64
6 Second Dose Administered 7621 non-null float64
7 Male (Doses Administered) 7461 non-null float64
8 Female (Doses Administered) 7461 non-null float64
9 Transgender (Doses Administered) 7461 non-null float64
10 Covaxin (Doses Administered) 7621 non-null float64
11 CoviShield (Doses Administered) 7621 non-null float64
12 Sputnik V (Doses Administered) 2995 non-null float64
13 AEFI 5438 non-null float64
14 18-44 Years (Doses Administered) 1702 non-null float64
15 45-60 Years (Doses Administered) 1702 non-null float64
16 60+ Years (Doses Administered) 1702 non-null float64
17 18-44 Years(Individuals Vaccinated) 3733 non-null float64
18 45-60 Years(Individuals Vaccinated) 3734 non-null float64
19 60+ Years(Individuals Vaccinated) 3734 non-null float64
20 Male(Individuals Vaccinated) 160 non-null float64
21 Female(Individuals Vaccinated) 160 non-null float64
22 Transgender(Individuals Vaccinated) 160 non-null float64
23 Total Individuals Vaccinated 5919 non-null float64
dtypes: float64(22), object(2)
memory usage: 1.4+ MB

[Link]()

Female Tr
Total Doses First Dose Second Dose Male (Doses
Sessions Sites (Doses
Administered Administered Administered Administered)
Administered) Adm

count 7.621000e+03 7.621000e+03 7621.000000 7.621000e+03 7.621000e+03 7.461000e+03 7.461000e+03 7

mean 9.188171e+06 4.792358e+05 2282.872064 7.414415e+06 1.773755e+06 3.620156e+06 3.168416e+06 1

std 3.746180e+07 1.911511e+06 7275.973730 2.995209e+07 7.570382e+06 1.737938e+07 1.515310e+07 5

min 7.000000e+00 0.000000e+00 0.000000 7.000000e+00 0.000000e+00 0.000000e+00 2.000000e+00

25% 1.356570e+05 6.004000e+03 69.000000 1.166320e+05 1.283100e+04 5.655500e+04 5.210700e+04

50% 8.182020e+05 4.547000e+04 597.000000 6.614590e+05 1.388180e+05 3.897850e+05 3.342380e+05

75% 6.625243e+06 3.428690e+05 1708.000000 5.387805e+06 1.166434e+06 2.735777e+06 2.561513e+06

max 5.132284e+08 3.501031e+07 73933.000000 4.001504e+08 1.130780e+08 2.701636e+08 2.395186e+08 98

# convert First Dose Administered to int


df['First Dose Administered'].isnull().sum()
df['First Dose Administered'].fillna(0,inplace=True)

df['First Dose Administered']=df['First Dose Administered'].astype(int)

C:\Users\dhere\AppData\Local\Temp\ipykernel_23476\[Link]: FutureWarning: A value is trying to be set on


a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on w
hich we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using '[Link]({col: value}, inplace=True)'
or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.

df['First Dose Administered'].fillna(0,inplace=True)

# for Second Dose Administered


df['Second Dose Administered'].isnull().sum()
df['Second Dose Administered'].fillna(0,inplace=True)

df['Second Dose Administered']=df['Second Dose Administered'].astype(int)


C:\Users\dhere\AppData\Local\Temp\ipykernel_23476\[Link]: FutureWarning: A value is trying to be set on
a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on w
hich we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using '[Link]({col: value}, inplace=True)'
or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.

df['Second Dose Administered'].fillna(0,inplace=True)

# For Male(Individuals Vaccinated)


df['Male(Individuals Vaccinated)'].isnull().sum()
df['Male(Individuals Vaccinated)'].fillna(0,inplace=True)

df['Male(Individuals Vaccinated)']=df['Male(Individuals Vaccinated)'].astype(int)

C:\Users\dhere\AppData\Local\Temp\ipykernel_23476\[Link]: FutureWarning: A value is trying to be set on


a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on w
hich we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using '[Link]({col: value}, inplace=True)'
or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.

df['Male(Individuals Vaccinated)'].fillna(0,inplace=True)

# For Female(Individuals Vaccinated)


df['Female(Individuals Vaccinated)'].isnull().sum()
df['Female(Individuals Vaccinated)'].fillna(0,inplace=True)

df['Female(Individuals Vaccinated)']=df['Female(Individuals Vaccinated)'].astype(int)

C:\Users\dhere\AppData\Local\Temp\ipykernel_23476\[Link]: FutureWarning: A value is trying to be set on


a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on w
hich we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using '[Link]({col: value}, inplace=True)'
or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.

df['Female(Individuals Vaccinated)'].fillna(0,inplace=True)

#B) Number of persons state wise vaccinated for first dose in India

# get sum of First Dose Administered for group by state


first_dose_vaccinated = [Link]('State')['First Dose Administered'].sum()
# remove india from the list
first_dose_vaccinated = first_dose_vaccinated.drop('India')
first_dose_vaccinated
p
State
Andaman and Nicobar Islands 16425854
Andhra Pradesh 1232860845
Arunachal Pradesh 49004980
Assam 585600226
Bihar 1470502878
Chandigarh 44703105
Chhattisgarh 796002902
Dadra and Nagar Haveli and Daman and Diu 33595063
Delhi 624339473
Goa 75991368
Gujarat 2131646009
Haryana 755798352
Himachal Pradesh 316294004
Jammu and Kashmir 410101777
Jharkhand 603673726
Karnataka 1873329968
Kerala 1193845072
Ladakh 17809249
Lakshadweep 4363655
Madhya Pradesh 1796604591
Maharashtra 2784364331
Manipur 67409568
Meghalaya 62615974
Mizoram 47873077
Nagaland 42410766
Odisha 1032633168
Puducherry 41346858
Punjab 584346582
Rajasthan 2201044187
Sikkim 36980929
Tamil Nadu 1288532512
Telangana 880320645
Tripura 192689726
Uttar Pradesh 2788411358
Uttarakhand 363191446
West Bengal 1796449989
Name: First Dose Administered, dtype: int64

# Plot graph of states vs first done vaccinated


first_dose_vaccinated.plot(kind='bar',figsize=(15,5))

<Axes: xlabel='State'>

#C) Number of persons state wise vaccinated for second dose in India

# get sum of Second Dose Administered for group by state


second_dose_vaccinated = [Link]('State')['Second Dose Administered'].sum()
# remove india from the list
second_dose_vaccinated = second_dose_vaccinated.drop('India')
second_dose_vaccinated

State
Andaman and Nicobar Islands 4118554
Andhra Pradesh 358817595
Arunachal Pradesh 11932317
Assam 130788792
Bihar 270790571
Chandigarh 11593735
Chhattisgarh 172120400
Dadra and Nagar Haveli and Daman and Diu 4594416
Delhi 188218946
Goa 16198174
Gujarat 600418376
Haryana 158656058
Himachal Pradesh 73838582
Jammu and Kashmir 85951651
Jharkhand 122121060
Karnataka 427187178
Kerala 364048753
Ladakh 5453762
Lakshadweep 1056446
Madhya Pradesh 316932957
Maharashtra 712881086
Manipur 11858150
Meghalaya 12166633
Mizoram 9998418
Nagaland 9204637
Odisha 251302794
Puducherry 8608859
Punjab 121120995
Rajasthan 491702988
Sikkim 9723640
Tamil Nadu 290670622
Telangana 198152946
Tripura 65270138
Uttar Pradesh 554435112
Uttarakhand 100085040
West Bengal 586146880
Name: Second Dose Administered, dtype: int64

# Plot graph of states vs second done vaccinated


second_dose_vaccinated.plot(kind='bar',figsize=(15,5))

<Axes: xlabel='State'>

#D)Number of Males vaccinated

# get sum of Male(Individuals Vaccinated)


male_vaccinated = df['Male(Individuals Vaccinated)'].sum()
print(f"Total Male Vaccinated are {male_vaccinated}")

Total Male Vaccinated are 7138698858

#E)Number of females vaccinated

# get sum of Female(Individuals Vaccinated)


Female_vaccinated = df['Female(Individuals Vaccinated)'].sum()
print(f"Total Female Vaccinated are {Female_vaccinated}")

Total Female Vaccinated are 6321628736

You might also like