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

13 J14 J15 Project

Uploaded by

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

13 J14 J15 Project

Uploaded by

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

# Import libraries

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

# Load your CSV file (ensure the file path is correct)


df = pd.read_csv('/Users/saranyarayaprolu/Downloads/IP project 2024.csv',
usecols=['Months', 'People Admitted', 'Health Checkups', 'No. of
Surgeries',
'Cardiology', 'Nuerology', 'Gyanacology', 'Dermatologist', 'Staff',
'Expenditure', 'Deaths'])
print(df)

# Assign columns to variables


Months = df['Months']
pa = df['People Admitted']
hc = df['Health Checkups']
ns = df['No. of Surgeries']
cd = df['Cardiology']
nl = df['Nuerology']
gy = df['Gyanacology']
dm = df['Dermatologist']
st = df['Staff']
deaths = df['Deaths']

print("Data Loaded Successfully!")


print("Options")
print("1. Show data")
print("2. Line plot")
print("3. Scatter plot")
print("4. Bar graph")

# Take user input


option = int(input("Choose an option (1-4): "))

# Option 1: Show the data


if option == 1:
print(df)

# Option 2: Line Plot


elif option == 2:
def line_plot():
plt.xlabel("Months")
print("Line Plot Options")
print("1. for Months vs People Admitted")
print("2. for Months vs Health Checkups")
print("3. for Months vs No. of Surgeries")
print("4. for Months vs Cardiology")
print("5. for Months vs Nuerology")
print("6. for Months vs Gyanacology")
print("7. for Months vs Dermatologist")
print("8. for Months vs Staff")
print("9. for Months vs Deaths")

opt = int(input("Select an option (1-9): "))

if opt == 1:
plt.ylabel("People Admitted")
plt.title("Months vs People Admitted")
plt.plot(Months, pa)
elif opt == 2:
plt.ylabel("Health Checkups")
plt.title("Months vs Health Checkups")
plt.plot(Months, hc)
elif opt == 3:
plt.ylabel("No. of Surgeries")
plt.title("Months vs No. of Surgeries")
plt.plot(Months, ns)
elif opt == 4:
plt.ylabel("Cardiology")
plt.title("Months vs Cardiology")
plt.plot(Months, cd)
elif opt == 5:
plt.ylabel("Nuerology")
plt.title("Months vs Nuerology")
plt.plot(Months, nl)
elif opt == 6:
plt.ylabel("Gyanacology")
plt.title("Months vs Gyanacology")
plt.plot(Months, gy)
elif opt == 7:
plt.ylabel("Dermatologist")
plt.title("Months vs Dermatologist")
plt.plot(Months, dm)
elif opt == 8:
plt.ylabel("Staff")
plt.title("Months vs Staff")
plt.plot(Months, st)
elif opt == 9:
plt.ylabel("Deaths")
plt.title("Months vs Deaths")
plt.plot(Months, deaths)
else:
print("Invalid option!")
return

plt.show()

# Call the line_plot function


line_plot()

# Option 3: Scatter Plot


elif option == 3:
def scatter_plot():
plt.xlabel("Months")
print("Scatter Plot Options")
print("1. for Months vs People Admitted")
print("2. for Months vs Health Checkups")
print("3. for Months vs No. of Surgeries")
print("4. for Months vs Cardiology")
print("5. for Months vs Nuerology")
print("6. for Months vs Gyanacology")
print("7. for Months vs Dermatologist")
print("8. for Months vs Staff")
print("9. for Months vs Deaths")

opt = int(input("Select an option (1-9): "))

if opt == 1:
plt.ylabel("People Admitted")
plt.title("Months vs People Admitted")
plt.scatter(Months, pa)
elif opt == 2:
plt.ylabel("Health Checkups")
plt.title("Months vs Health Checkups")
plt.scatter(Months, hc)
elif opt == 3:
plt.ylabel("No. of Surgeries")
plt.title("Months vs No. of Surgeries")
plt.scatter(Months, ns)
elif opt == 4:
plt.ylabel("Cardiology")
plt.title("Months vs Cardiology")
plt.scatter(Months, cd)
elif opt == 5:
plt.ylabel("Nuerology")
plt.title("Months vs Nuerology")
plt.scatter(Months, nl)
elif opt == 6:
plt.ylabel("Gyanacology")
plt.title("Months vs Gyanacology")
plt.scatter(Months, gy)
elif opt == 7:
plt.ylabel("Dermatologist")
plt.title("Months vs Dermatologist")
plt.scatter(Months, dm)
elif opt == 8:
plt.ylabel("Staff")
plt.title("Months vs Staff")
plt.scatter(Months, st)
elif opt == 9:
plt.ylabel("Deaths")
plt.title("Months vs Deaths")
plt.scatter(Months, deaths)
else:
print("Invalid option!")
return

plt.show()

# Call the scatter_plot function


scatter_plot()
# Option 4: Bar Graph
elif option == 4:
def bar_graph():
plt.xlabel("Months")
print("Bar Graph Options")
print("1. for Months vs People Admitted")
print("2. for Months vs Health Checkups")
print("3. for Months vs No. of Surgeries")
print("4. for Months vs Cardiology")
print("5. for Months vs Nuerology")
print("6. for Months vs Gyanacology")
print("7. for Months vs Dermatologist")
print("8. for Months vs Staff")
print("9. for Months vs Deaths")

opt = int(input("Select an option (1-9): "))

if opt == 1:
plt.ylabel("People Admitted")
plt.title("Months vs People Admitted")
plt.bar(Months, pa)
elif opt == 2:
plt.ylabel("Health Checkups")
plt.title("Months vs Health Checkups")
plt.bar(Months, hc)
elif opt == 3:
plt.ylabel("No. of Surgeries")
plt.title("Months vs No. of Surgeries")
plt.bar(Months, ns)
elif opt == 4:
plt.ylabel("Cardiology")
plt.title("Months vs Cardiology")
plt.bar(Months, cd)
elif opt == 5:
plt.ylabel("Nuerology")
plt.title("Months vs Nuerology")
plt.bar(Months, nl)
elif opt == 6:
plt.ylabel("Gyanacology")
plt.title("Months vs Gyanacology")
plt.bar(Months, gy)
elif opt == 7:
plt.ylabel("Dermatologist")
plt.title("Months vs Dermatologist")
plt.bar(Months, dm)
elif opt == 8:
plt.ylabel("Staff")
plt.title("Months vs Staff")
plt.bar(Months, st)
elif opt == 9:
plt.ylabel("Deaths")
plt.title("Months vs Deaths")
plt.bar(Months, deaths)
else:
print("Invalid option!")
return

plt.show()

# Call the bar_graph function


bar_graph()

# Handle invalid options


else:
print("Invalid option! Please choose a valid option (1-4).")

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