text_html_output_1.png
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import matplotlib.pyplot as plt
import seaborn as sns
age_groups = pd.read_csv('/kaggle/input/covid19-in-india/AgeGroupDetails.csv')

std = pd.read_csv('/kaggle/input/covid19-in-india/StatewiseTestingDetails.csv')
std = std.drop(['Date'], axis=1)

x = std.groupby(['State'], as_index=False).max()
x['State / Union Territory'] = x['State']
x = x.drop(['State'], axis=1)

x.sort_values(by='Positive', ascending=False).head(5)

pop = pd.read_csv('/kaggle/input/covid19-in-india/population_india_census2011.csv')

pop['Area/km2'] = pop['Area'].str.split(expand=True)[0]
pop['Density/km2'] = pop['Density'].str.split('/', expand=True)[0]
pop = pop.drop(['Sno', 'Population', 'Rural population', 'Urban population', 'Gender Ratio', 'Area', 'Density'], axis=1)

pop.to_csv('pop.csv', index=False)

covid = pd.read_csv('/kaggle/input/covid19-in-india/covid_19_india.csv')

y = covid.groupby(['State/UnionTerritory'], as_index=False)['Cured', 'Deaths', 'Confirmed'].max()
y['State / Union Territory'] = y['State/UnionTerritory']
y = y.drop(['State/UnionTerritory'], axis=1)

master = pd.merge(pop, y, how='inner')
master = master.sort_values(by='Confirmed', ascending=False)

master2 = pd.merge(master, x)
master2 = master2.drop(['Negative', 'Positive'], axis=1)

beds = pd.read_csv('/kaggle/input/covid19-in-india/HospitalBedsIndia.csv')

beds = beds.drop(['NumPrimaryHealthCenters_HMIS', 'NumCommunityHealthCenters_HMIS', 'NumSubDistrictHospitals_HMIS', 'NumDistrictHospitals_HMIS'], axis=1)

beds['TotalPublicHealthFacilities_NHP18'] = beds['NumRuralHospitals_NHP18'] + beds['NumUrbanHospitals_NHP18']
beds = beds.drop(['Sno', 'NumRuralHospitals_NHP18', 'NumUrbanHospitals_NHP18'], axis=1)
beds['TotalBeds_HMIS'] = beds['NumPublicBeds_HMIS']
beds = beds.drop(['NumPublicBeds_HMIS'], axis=1)
beds['TotalBeds_NHP18'] = beds['NumRuralBeds_NHP18'] + beds['NumUrbanBeds_NHP18']
beds = beds.drop(['NumRuralBeds_NHP18', 'NumUrbanBeds_NHP18'], axis=1)

beds_hmis = beds[['State/UT', 'TotalPublicHealthFacilities_HMIS', 'TotalBeds_HMIS']]
beds_hmis = beds_hmis[:-1]
beds_hmis['State / Union Territory'] = beds_hmis['State/UT']
beds_nhp18 = beds[['State/UT', 'TotalPublicHealthFacilities_NHP18', 'TotalBeds_NHP18']]
beds_nhp18 = beds_nhp18[:-1]
beds_nhp18['State / Union Territory'] = beds_nhp18['State/UT']

print(beds_hmis.shape)