Project Code Samples
Project Code Samples
# Showing the literacy rate of India 1951 - 2011 data post conversion into the
dataframe
print("The Vaccine Status of all the States of India in 2021 \n")
Vdf=pa.read_csv('../input/vaccineindia2021/Vaacine.csv')
print("Let us see some Graphical Comparison of \n 1. Gender Wise Total and Average
Vaccines Adminstered. \n")
print("2. Doses Wise Total and Average Vaccines Administered \n")
print("3. Average and Total of Each Type of Vaccines Administered \n")
print("4. Average and Total of Each State's Population Vaccines Administered \n")
print("Line Graph for Gender Wise Comparison of Total Vaccines Adminstered. \n")
a=Vdf['Male (Doses Administered)'].sum()
b=Vdf['Female (Doses Administered)'].sum()
c=Vdf['Transgender (Doses Administered)'].sum()
y=['Male (Doses Administered)','Female (Doses Administered)','Transgender (Doses
Administered)']
plt.plot(y,[a,b,c])
plt.title('Comparison of Total Doses Administered Gender Wise ', color='red')
plt.xlabel("Gender", color='red', fontsize=11)
plt.ylabel ("Total Doses", color='Green', fontsize=11)
plt.show()
print("\n Bar Graph for Doses Wise Total Vaccines Administered \n")
import os
for dirname, _, filenames in os.walk('/kaggle/input'):
for filename in filenames:
print(os.path.join(dirname, filename))
# You can write up to 20GB to the current directory (/kaggle/working/) that gets
preserved as output when you create a version using "Save & Run All"
# You can also write temporary files to /kaggle/temp/, but they won't be saved
outside of the current session
# Load data
print("The Vaccine Status of all the States of India in 2021 \n")
Vdf = pd.read_csv('/kaggle/input/vaccineindia2021/Vaacine.csv') # Adjusted path to the
uploaded file
def show_data(choice):
if choice == '1':
print("Total Vaccine Administered Dose Wise and State Wise")
a = Vdf.groupby('State')['First Dose Administered'].sum()
b = Vdf.groupby('State')['Second Dose Administered'].sum()
c = Vdf.groupby('State')['Total Doses Administered'].sum()
print("\nState Wise - Total First Dose Administered\n", a)
print("\nState Wise - Total Second Dose Administered\n", b)
print("\nState Wise - Total Third Dose Administered\n", c)
tot_first_doses = Vdf['First Dose Administered'].sum()
tot_second_doses = Vdf['Second Dose Administered'].sum()
tot_doses = Vdf['Total Doses Administered'].sum()
print("\nTotal First Dose Administered in India =", tot_first_doses)
print("Total Second Dose Administered in India =", tot_second_doses)
print("Total Doses Administered in India =", tot_doses)
def execute_choice(choice):
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def display_menu():
print("Choose a number between 1 and 6 to see:")
print("1. Total Vaccine Administered Dose Wise and State Wise")
print("2. Total Vaccine Administered Gender Wise and State Wise")
print("3. Total of Each Type of Vaccine and State Wise")
print("4. Total of Individuals Vaccinated State Wise")
print("5. Average of Doses Administered, Each Type of Vaccine, Genders Vaccinated")
print("6. Highest and Lowest Vaccinated State in India")
print("Enter '0' to exit.")
def execute_choice(choice):
if choice == '1':
print("Total Vaccine Administered Dose Wise and State Wise")
a = Vdf.groupby('State')['First Dose Administered'].sum()
b = Vdf.groupby('State')['Second Dose Administered'].sum()
c = Vdf.groupby('State')['Total Doses Administered'].sum()
print("\nState Wise - Total First Dose Administered\n", a)
print("\nState Wise - Total Second Dose Administered\n", b)
print("\nState Wise - Total Third Dose Administered\n", c)
tot_first_doses = Vdf['First Dose Administered'].sum()
tot_second_doses = Vdf['Second Dose Administered'].sum()
tot_doses = Vdf['Total Doses Administered'].sum()
print("\nTotal First Dose Administered in India =", tot_first_doses)
print("Total Second Dose Administered in India =", tot_second_doses)
print("Total Doses Administered in India =", tot_doses)
while True:
display_menu()
choice = input("Enter the number of your choice (1 to 6) or '0' to exit: ")
if choice == '0':
print("Exiting...")
break
elif choice in ['1', '2', '3', '4', '5', '6']:
execute_choice(choice)
else:
print("Invalid choice. Please enter a number between 1 and 6, or '0' to exit.")