Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 40

Informatics Practices – (065)

(Term-2)

By

Siddharth Parakh
(Project)
Under Guidance

Of

Mr. Shyam Singh Sikarwar


Submitted to the Central Board of Secondary Education, CBSE in partial fulfillment of the

Requirements for the award of Senior Secondary Certificate

Year of Submission

2022 - 2023
S.NO. Content
1. Certificate of Originality
2. Acknowledgement
3. Introduction to Project
4. Hardware Requirement
5. Software Requirement
6. Coding
7. Output
8. Bibliography
CERTIFICATE OF ORIGINALITY

This is to certify that the project report entitled “Hospital Data Analysis”

submitted to Central Board of Secondary Education in partial

fulfillment of the requirement for the award of the degree Senior

Secondary (12th), is an authentic and original work carried out by

Siddharth Parakh with roll no. _______________ Under my guidance.

The matter embodied in this project is genuine work done by the student

and has not been submitted whether to this Board or to any other

Institution for the fulfillment of the requirements of any course of study.

……………………….……………

Signature of Teacher

Mr. Shyam Singh Sikarwar

Name of the Teacher

……………………….……………
Date of Signature
ACKNOWLEDGEMENT

In the accomplishment of this project successfully, many people have


best owned upon me their blessings and the heart pledged support,
this time I am utilizing to thank to all people who have been
concerned with this project.

Primarily I would thank god for being able to complete this project
with success, then I would like to thank my principal Mrs.
Maitreyi Shukla and Informatics Practices teacher Mr.
Shyam Singh Sikarwar, whose valuable guidance has been
the ones that helped me patch this project and make it full proof
success. His suggestions and instructions have served as the major
contributor towards the completion of the project.

Then I would like to thank my parents and friends who have helped
me with their valuable suggestion and guidance has been very
helpful in various phases of the completion of the project.

Last but not the least I would like to thank my classmates who have
helped me a lot.

Siddharth Parakh
Class – 12 th C
1. Introduction of Project

This project is created to analyze the data of All Clinical Care Hospital

having data of doctors of district (Jaipur, Jaisalmer, Alwar, Ajmer) data of

patients suffering from disease (covid, tuberculosis, pneumonia, malaria,

typhoid). Use of pandas and matplotlib library in programs involving

analysis of a hospital data is highly profitable as pandas library provides

efficiency to manage big data sets and matplotlib library help us to analyze

the patterns and predict future decisions to be made for hospital .

This software, being simple in design and working, does not require much

of training to users, and can be used as a powerful tool for analyzing the

data of different doctors and patients and multiple graphs of the data.

During coding and design of the software Project, Python IDLE, a

powerful frontend tool is used for an integrated platform and coding

simplicity, is used as per requirement of the CBSE curriculum of

Informatics Practices Course.


Hardware and Software Requirement

 x86 64-bit CPU (Intel / AMD architecture)


 4 GB RAM
 5 GB free disk space

 Modern Operating System:


o Windows 7 or higher
o Mac OS X 10.11 or higher, 64-bit
o Linux: RHEL 6/7, 64-bit (almost all libraries also work in Ubuntu)
 Python IDLE

Coding
import pandas as pd

import matplotlib.pyplot as plt

import numpy as np

df = pd.DataFrame()

csv_file1= "G:\\Project\\csv1.csv"

csv_file2= "G:\\Project\\csv2.csv"

def hospital_data_analysis1():
df1 = pd.read_csv(csv_file1)

while 0<1:

print('\n Presenting Hospital Data Analysis')

print('*'*100)

print(" Welcome")

print('*'*100,"\n")

print('1. Presenting whole DataFrame.\n')

print('2. Presenting the columns of DataFrame.\n')

print('3. Presenting the specific row/column of DataFrame.\n ')

print('4. Putting on/Eliminating column.\n')

print('5. Putting on/Eliminating row.\n')

print('6. Data summary.\n')

print('7. Hunting for a particular record.\n')

print('8. Presenting the top and bottom records.\n')

print('9. Classifying records in ascending and descending order.\


n')

print('10. Exit from Data Analysis Menu and Go to Graph Menu.\


n')

ch1 = int(input('Enter your choice:'))


if ch1 == 1:

print(df1)

print('\n\n\n Press any key to continue....')

wait = input()

if ch1 == 2:

print(df1.columns)

print('\n\n\n Press any key to continue....')

wait = input()

if ch1 == 3:

print("\n",df1.columns,"\n")

col_name = input('Enter Column Name that You want to print : ')

print(df1[col_name])

print('\n\n\n Press any key to continue....')

wait = input()

if ch1 == 4:

col_name = input('Enter the column name which you want to delete:')

df1=df1.drop(col_name,axis=1)

print(df1)

print('\n\n\n Press any key to continue....')

wait = input()
if ch1 == 5:

a = int(input('Enter doctor_id in numbers :'))

b = input('Enter name of doctor :')

c = input('Enter the working department of doctor :')

d = input('Enter gender(M or F):')

e = int(input('Enter age of doctor :'))

f = input('Enter the city from which the doctor is:')

g = int(input('Enter the salary of doctor:'))

h = int(input("Enter the year of joining of doctor :"))

i = int(input('Enter the year of experience a doctor have :'))

j = int(input("Enter the no of patients attended per day by the


doctor :"))

k = int(input("Enter the no of surgeries done by the doctor :"))

l = input("Enter the grade of the doctor :")

data={"doctor_id":a,"name":b,"department":c,"gender":d,"age":e,"cit
y":f,"salary":g,"year_of_joining":h,"year_of_experience":i,"no.of_patie
nts_attended_per_day":j,"no.of_surgeries":k,"grade":l}

df1 = df1.append(data,ignore_index=True)

print(df1)

print('\n\n\n Press any key to continue....')

wait = input()
if ch1==6:

print(df1.describe())

print('\n\n\n Press any key to continue....')

wait=input()

if ch1==7:

i=int(input('Enter doctor_id whose data needs to be presented : '))

print("\n Following is the data of the doctor_id- ",i,"\n")

print(df1.loc[df1.doctor_id==i, : ])

print('\n\n\n Press any key to continue....')

wait = input()

if ch1 == 8:

col=int(input("Enter number of records which you want to


display from Top or Bottom : "))

T=input("Press H to show Top or T for bottom records : ")

if T == "H":

print(df1.head(col))

else:

print(df1.tail(col))

print('\n\n\n Press any key to continue....')

wait = input()

if ch1 == 9:
print(df1.columns)

col_name=input("Enter the column name which you want to sort :")

S=input("Press A to show Ascending or D for Descending


records : ")

if S == "A":

print(df1.sort_values(col_name))

else:

print(df1.sort_values(col_name,ascending= False))

print('\n\n\n Press any key to continue....')

wait=input()

if ch1 == 10:

break

def hospital_data_analysis2():

df2 = pd.read_csv(csv_file2)

while 0<1:

print('\n Presenting Hospital Data Analysis')

print('*'*100)

print(" Welcome")

print('*'*100,"\n")

print('1. Presenting the columns of DataFrame.\n')

print('2. Presenting the row of DataFrame.\n')


print('3. Presenting the specific row/column of DataFrame.\n ')

print('4. Putting on/Eliminating column.\n')

print('5. Putting on/Eliminating row.\n')

print('6. Data summary.\n')

print('7. Hunting for a particular record.\n')

print('8. Presenting the top and bottom records.\n')

print('9. Classifying records in ascending and descending order.\


n')

print('10. Exit from Data Analysis Menu and Go to Graph Menu.\


n')

ch2 = int(input('Enter your choice:'))

if ch2 == 1:

print(df2)

print('\n\n\n Press any key to continue....')

wait = input()

if ch2 == 2:

print(df2.columns)

print('\n\n\n Press any key to continue....')

wait = input()
if ch2 == 3:

print("\n",df2.columns,"\n")

col_name = input('Enter Column Name that You want to print : ')

print(df2[col_name])

print('\n\n\n Press any key to continue....')

wait = input()

if ch2 == 4:

col_name = input('Enter the column name which you want to delete:')

df2=df2.drop(col_name,axis=1)

print(df2)

print('\n\n\n Press any key to continue....')

wait = input()

if ch2 == 5:

a = int(input('Enter patient_id in numbers :'))

b = input('Enter name of patient :')

c = input('Enter gender(M or F):')

d = int(input('Enter age :'))

e = input('Enter the disease from which the patient is suffering


with:')

f = input('Enter the room alloted to the patient :')

g = int(input('Enter the ward number of the patient :'))


h = input("Enter the name of doctor who is treating the
patient :")

i = int(input('Enter the per day consultation charge :'))

j = int(input("Enter the per day room charge:"))

k = int(input("Enter total amount of per day :"))

data={"patient_id":a,"name":b,"gender":c,"age":d,"disease":e,"room"
:f,"ward-
number":g,"treated_by":h,"per_day_consultation_fee":i,"per_day_char
ge_of_room":j,"total_amountofperday":k}

df2 = df2.append(data,ignore_index=True)

print(df2)

print('\n\n\n Press any key to continue....')

if ch2==6:

print(df2.describe())

print('\n\n\n Press any key to continue....')

wait=input()

if ch2==7:

i=int(input('Enter patient_id whose data needs to be presented : '))

print("\n Following is the data of the patient_id- ",i,"\n")

print(df2.loc[df2.patient_id==i, : ])

print('\n\n\n Press any key to continue....')

wait = input()
if ch2== 8:

col=int(input("Enter number of records which you want to


display from Top or Bottom : "))

T=input("Press H to show Top or T for bottom records : ")

if T == "H":

print(df2.head(col))

else:

print(df2.tail(col))

print('\n\n\n Press any key to continue....')

wait = input()

if ch2 == 9:

print(df2.columns)

col_name=input("Enter the column name which you want to sort :")

S=input("Press A to show Ascending or D for Descending


records : ")

if S == "A":

print(df2.sort_values(col_name))

else:

print(df2.sort_values(col_name,ascending= False))

print('\n\n\n Press any key to continue....')

wait=input()
if ch2 == 10:

break

def graph1():

df1 = pd.read_csv(csv_file1,index_col="doctor_id")

while True:

print('Presenting graphical statistics of Hospital data.\n')

print('*'*100)

print('1. Presenting a line graph for displaying Number of Doctors


working in Each department.\n')

print('2. Presenting a bar graph for Number of doctors working in


city.\n')

print('3. Presenting a bar graph for Number of doctors of different


grades. \n')

print('4. Exit (Exit From Graph Menu)\n')

ch1 = int(input('Enter your choice:'))

if ch1 == 1:

g = df1.groupby('department')

x = df1['department'].unique()

y = g['department'].count()

plt.plot(x,y,color="r")
plt.xticks(rotation='vertical')

plt.xlabel("Departments")

plt.ylabel("Number of Doctors working")

plt.title("Number of Doctors working in Each department")

plt.grid(True)

plt.show()

if ch1 == 2:

g = df1.groupby('city')

x = df1['city'].unique()

y = g['city'].count()

plt.bar(x,y,color= 'r')

plt.xticks(rotation='vertical')

plt.xlabel("City")

plt.ylabel("Number of Doctors available")

plt.title("Number of Doctors available in Each city")

plt.grid(True)

plt.show()

if ch1 ==3:

g = df1.groupby('grade')

x = df1['grade'].unique()
y = g['grade'].count()

plt.bar(x,y,color= 'c')

plt.xticks(rotation='vertical')

plt.xlabel("Grade")

plt.ylabel("Number of Doctors")

plt.title("Number of Doctors available in Different grade")

plt.grid(True)

plt.show()

if ch1 == 4:

break

def graph2():

df2 = pd.read_csv(csv_file2)

while True:

print('Presenting graphical statistics of Hospital data.\n')

print('*'*100)

print('1. Creating a line graph for Number of patients admitted with


specific diseases.\n')

print('2. Creating a bar graph for Number of patients admitted in


each room.\n')

print('3. Creating a histogram for Number of patients admitted in


specific age group.\n')
print('4. Exit (Exit From Graph Menu)\n')

ch2 = int(input('Enter your choice:'))

if ch2 == 1:

g = df2.groupby('disease')

x = df2['disease'].unique()

y = g['disease'].count()

plt.plot(x,y,'g*', linestyle= 'dashed')

plt.xticks(rotation='vertical')

plt.xlabel("Disease")

plt.ylabel("Number of Patients affected")

plt.title("Number of patients admitted with specific diseases.")

plt.grid(True)

plt.show()

if ch2 == 2:

g= df2.groupby('room')

x = df2['room'].unique()

y = g['room'].count()

plt.bar(x,y,color= 'm')

plt.xticks(rotation='vertical')
plt.xlabel("Room")

plt.ylabel("Number of Patients admitted")

plt.title("Number of patients admitted in specific room.")

plt.grid(True)

plt.show()

if ch2 ==3:

x = df2['age']

plt.hist(x)

plt.xlabel("Age")

plt.ylabel("Number of Patients affected")

plt.title("Number of patients admitted in specific age group.")

plt.grid(True)

plt.show()

if ch2 == 4:

break

hospital_data_analysis1()

graph1()

hospital_data_analysis2()

graph2()
print("Thanks For Visiting")

Output

Welcome Screen:
On selecting option 1

On selecting option 2
On selecting option 3

On selecting option 4
On selecting option 5

On selecting option 6
On selecting option 7

On selecting option 8

On selecting option 9
On selecting option 10
On selecting option 1 (In Graph Menu)

On selecting option 2 (In Graph Menu)


On selecting option 3 (In Graph Menu)

On selecting option 4 (In Graph Menu)


Excel view of CSV used Here ( csv1.csv)
Output
Welcome Screen:

On selecting option 1
On selecting option 2
On selecting option 3

On selecting option 4
On selecting option 5
On selecting option 6

On selecting option 7

On selecting option 8
On selecting option 9

On selecting option 10
On selecting option 1 (In Graph Menu)

On selecting option 2 (In Graph Menu)


On selecting option 3 (In Graph Menu)
On selecting option 4 (In Graph Menu)

Excel view of CSV used Here ( csv2.csv)

Bibliography
References:
 Informatics Practices (by NCERT)
 Informatics Practices (by Sumita Arora)
 Data of CSV is secondary data obtained from various sites of
hospitals.

You might also like