PATIENT MANAGEMENT PROJECT
USING CSV
GRADE XII
import pandas as pd
import matplotlib.pyplot as plt
def main():
while True:
print("="*60)
print("enter 1 to ADD PATIENT DETAILS")
print("enter 2 to DELETE PATIENT DETAIL")
print("enter 3 to UPDATE PATIENT DETAIL")
print("enter 4 to SEARCH PATIENT ")
print("enter 5 to DISPLAY PATIENT DETAILS")
print("enter 6 to DISPLAY CITY WISE GRAPH")
print("enter 7 to EXIT....")
d=int(input("enter choice:"))
print("="*60)
if d==1:
add()
elif d==2:
delete()
elif d==3:
update()
elif d==4:
search()
elif d==5:
display()
elif d==6:
gra()
elif d==8:
print("*********THANKS FOR USING HOSPITAL/PATIENT MANAGEMENT SYSTEM**********")
break
else:
print("Enter correct choice. . .")
def add():
print("---------------------------------------------------------------------------")
print("---------------------------------------------------------------------------")
df=pd.read_csv("D:\GRADE XII PYTHON/patients.csv",index_col=0)
pid=int(input("Enter pid"))
if len(df.loc[df['pid']==pid])>0:
print("Duplicate Record")
else:
name=input("Enter NAME")
cla=input("Enter AGE")
sec=input("Enter GENDER")
addr=input("Enter ADDRESS")
dise=input("Enter DISEASE")
df.loc[pid]=[pid,name,cla,sec,addr,dise]
df.to_csv("D:\GRADE XII PYTHON/patients.csv",mode="w")
print("RECORD ADDED SUCCESSFULLY")
print("="*60)
def update():
print("---------------------------------------------------------------------------")
print("---------------------------------------------------------------------------")
df=pd.read_csv("D:\GRADE XII PYTHON/patients.csv",index_col=0)
pid=int(input("Enter PATIENT ID:"))
if len(df.loc[df['pid']==pid])>0:
name=input("Enter name")
age=input("Enter AGE")
gen=input("Enter GENDER")
addr=input("Enter ADDRESS")
dise=input("Enter DISEASE")
df.loc[pid]=[pid,name,age,gen,addr,dise]
df.to_csv("D:\GRADE XII PYTHON/patients.csv",mode="w")
print("RECORD ADDED SUCCESSFULLY")
print("="*60)
else:
print("Invalid Patient Id")
def display():
df=pd.read_csv("D:\GRADE XII PYTHON/patients.csv",index_col=0)
print(df)
print("="*60)
def delete():
print("---------------------------------------------------------------------------")
print("---------------------------------------------------------------------------")
df=pd.read_csv("D:\GRADE XII PYTHON/patients.csv",index_col=0)
pid=int(input("Enter Pid"))
if len(df.loc[df['pid']==pid])>0:
df.drop(pid,inplace=True)
df.to_csv("D:\GRADE XII PYTHON/patients.csv",mode="w")
print("Record Deleted")
print("="*60)
def search():
print("---------------------------------------------------------------------------")
print("---------------------------------------------------------------------------")
df=pd.read_csv("D:\GRADE XII PYTHON/patients.csv",index_col=0)
pid=int(input("Enter Pid"))
if len(df.loc[df['pid']==pid])>0:
print(df.loc[pid])
print("="*60)
else:
print("Record not Found")
print("="*60)
def gra():
df=pd.read_csv("D:\GRADE XII PYTHON/patients.csv",index_col=0)
plt.plot(df['address'],label="CITY WISE GRAPH")
plt.title("CITY WISE GRAPH")
plt.xlabel("CITY")
plt.ylabel("PATIENTS")
plt.xticks(rotation=30)
plt.legend()
plt.grid(True)
plt.show()
main()
CRICKET ANALYSIS
# -*- coding: utf-8 -*-
"""
Created on Wed May 10 09:38:20 2023
@author: Kirti Hora
"""
import pandas as pd
import matplotlib.pyplot as plt
while True:
print("MAIN MENU")
print("1.Dataframe Stats")
print("2.Record Analysis")
print("3.Insert Delete Record")
print("4.Data Visualization as per records")
print("5.Customized Data Visualization")
print("6.Exit")
ch=int(input("Enter Your Choice:"))
if(ch==1):
df=pd.read_csv("t20wc.csv")
print("Dataframe Properties:")
print("1.Diplay the transpose")
print("2.Display column names")
print("3.Display indexes")
print("4.Display the shape")
print("5.Display the dimension")
print("6.Display the data types of all columns")
print("7.Display the size")
print("8.Back")
ch1=int(input("Enter Your Choice:"))
if ch1==1:
print(df.T)
input("Press Enter to continue...")
elif ch1==2:
print(df.columns)
input("Press Enter to continue...")
elif ch1==3:
print(df.index)
input("Press Enter to continue...")
elif ch1==4:
print(df.shape)
input("Press Enter to continue...")
elif ch1==5:
print(df.ndim)
input("Press Enter to continue...")
elif ch1==6:
print(df.dtypes)
input("Press Enter to continue...")
elif ch1==7:
print(df.size)
input("Press Enter to continue...")
elif ch1==8:
pass
elif ch==2:
df=pd.read_csv("t20wc.csv")
print("RECORD ANALYSIS MENU")
print("1.Highest Score (Inning - Top 10)")
print("2.Lowest Score (Inning - Botton 10)")
print("3.Specific Number of Records From Top")
print("4.Specific Number of Records From Bottom")
print("5.Details record for Sr.No.")
print("6.Details record for a Team")
print("7.Details record for a Batsman")
print("8.Most Runs (Top Ten)")
print("9.Least Runs (Bottom Ten)")
print("0.Back")
ch2=int(input("Enter Your Choice:"))
if ch2==1:
df1=df.loc[:,['city','name','runs','ballsFaced']]
df1=df1.sort_values(by='runs',ascending=False)
print(df1.head(10))
input("Press Enter to continue...")
elif ch2==2:
df1=df.loc[:,['city','name','runs','ballsFaced']]
df1=df1.sort_values(by='runs',ascending=False)
print(df1.tail(10))
input("Press Enter to continue...")
elif ch2==3:
no=int(input("How Many Number of Records You Want To Be Printed From The Top:"))
df1=df.loc[:,['city','name','runs','ballsFaced']]
print(df1.head(no))
input("Press enter to continue...")
elif ch2==4:
n=int(input("How Many Number of Records You Want To Be Printed From Bottom:"))
df1=df.loc[:,['city','name','runs','ballsFaced']]
print(df1.tail(n))
input("Press enter to continue...")
elif ch2==5:
sno=int(input("Enter The Sr.No. For Which You Want The data To Be Displayed:"))
print(df.loc[sno])
input('Press enter to continue...')
elif ch2==6:
team=input("Enter The Sr.No. For Which You Want The data To Be Displayed:")
df1=df.loc[df['team']==team]
print(df1.loc[:,['city','name','runs','ballsFaced']])
input('Press enter to continue...')
elif ch2==7:
print("Ensure the name should match with CSV records:")
b=input("Enter The Sr.No. For Which You Want The data To Be Displayed:")
df1=df.loc[df['name']==b]
print(df1.loc[:,['city','name','runs','ballsFaced']])
print('------------------------------------------------')
df1.at['Total','runs']=df1['runs'].sum()
print(df1)
input('Press enter to continue...')
elif ch2==8:
df1=df[['name','runs']].groupby('name').sum()
df1=df1.sort_values(by='runs',ascending=False)
print(df1.head(10))
input("Press enter to continue...")
elif ch2==9:
df1=df[['name','runs']].groupby('name').sum()
df1=df1.sort_values('runs')
print(df1.head(10))
input("Press enter to continue...")
elif ch2==0:
pass
else:
print("Invalid Choice")
elif(ch==3):
df=pd.read_csv("t20wc.csv")
print("Insert Delete record")
print("1.Insert a record")
print("2.Delete a records")
print("3.Exit The Records Menu")
ch3=int(input("Enter Your Choice:"))
if ch3==1:
col=df.columns
print(col)
j=0
rec={}
for i in col:
print("Enter",col[j],"value:")
nval=input()
rec[col[j]]=nval
j=j+1
df=df.append(rec,ignore_index=True)
print("Data is Successfully Updated")
df.to_csv('t20wc.csv',index=False)
input("Press enter to continue...")
elif ch3==2:
a=int(input("Enter S.No. whose data You Want to be deleted:"))
df.drop([a-1],inplace=True)
df.to_csv('t20wc.csv',index=False)
print("Record deleted...")
input("Press enter to continue...")
elif ch3==3:
pass
elif(ch==4):
df=pd.read_csv("t20wc.csv")
print("Data Visualization Menu - According to no. of rows")
print("1.Line Plot")
print("2.Vertical Bar Plot")
print("3.Horizontal Bar Plot")
print("4.Histogram")
print("5.Exit The Data Visualization Menu")
ch4=int(input("Enter Choice:"))
df1=pd.DataFrame()
if ch4==1:
n=int(input("How many records from the top of table you want to plot:"))
df1=df.head(n)
df1.plot(linestyle="-.",linewidth=2,label="WORLD CUP RECORD OF MS DHONI")
plt.show()
elif ch4==2:
n=int(input("How many records from the top of table you want to plot:"))
df1=df.head(n)
df1.plot(kind="bar",color="pink",width=.8)
plt.show()
elif ch4==3:
n=int(input("How many records from the top of table you want to plot:"))
df1=df.head(n)
df1.plot(kind="barh",color="cyan",width=.8)
plt.show()
elif ch4==4:
df.hist(color="yellow",edgecolor="pink")
plt.show()
elif ch4==5:
pass
elif(ch==5):
df=pd.read_csv("t20wc.csv")
print("Customized Data Visualization Menu")
print("1.By Player")
print("2.By Team")
print("3.Back")
ch5=int(input("Enter Choice:"))
df1=pd.DataFrame()
if ch5==1:
print("Ensure the name should match with CSV records:")
player=input("Enter player name you want to plot:")
print('''
1. Line Chart
2. Bar Chart
3. Horizontal Bar Chart
4. Histogram
5. Back
''')
ch5_1=int(input("Enter your choice:"))
if ch5_1==1:
df1=df.loc[df['name']==player]
df1=df1.loc[:,['against','runs']]
df1.plot(x='against',y='runs',kind='line',linestyle="-.",linewidth=2,color='r')
plt.show()
elif ch5_1==2:
df1=df.loc[df['name']==player]
df1=df1.loc[:,['against','runs']]
df1.plot(x='against',y='runs',kind='bar',color='r')
plt.show()
elif ch5_1==3:
df1=df.loc[df['name']==player]
df1=df1.loc[:,['against','runs']]
df1.plot(x='against',y='runs',kind='barh',color='r')
plt.show()
elif ch5_1==4:
df1=df.loc[df['name']==player]
df1=df1.loc[:,['against','runs']]
df1.plot(x='against',y='runs',kind='hist',bins=25,cumulative=True)
plt.show()
elif cf5_1==5:
pass
elif ch5==2:
print("Ensure the name should match with CSV records:")
team=input("Enter team name you want to plot:")
print('''
1. Line Chart
2. Bar Chart
3. Horizontal Bar Chart
4. Histogram
5. Back
''')
ch5_2=int(input("Enter your choice:"))
if ch5_2==1:
df1=df.loc[df['team']==team]
df1=df1.loc[:,['name','runs']]
df1.plot(x='name',y='runs',kind='line',linestyle="-.",linewidth=2,color='r')
plt.show()
elif ch5_2==2:
df1=df.loc[df['team']==team]
df1=df1.loc[:,['name','runs']]
df1.plot(x='name',y='runs',kind='bar',color='r')
plt.show()
elif ch5_2==3:
df1=df.loc[df['team']==team]
df1=df1.loc[:,['name','runs']]
df1.plot(x='name',y='runs',kind='barh',color='r')
plt.show()
elif ch5_2==4:
df1=df.loc[df['team']==team]
df1=df1.loc[:,['name','runs']]
df1.plot(x='name',y='runs',kind='hist',bins=25,cumulative=True)
plt.show()
elif ch5_2==5:
pass
elif ch==6:
print(' Downloaded from www.tutorialaicsip.com')
print("Thanks for visiting our blog, for more projects stay tuned with us!!!")
break
else:
print("*---------------------*INVALID CHOICE*---------------------*")
print(' Downloaded from www.tutorialaicsip.com ')
print("Thanks for visiting our blog, for more projects stay tuned with us!!!")
MARKS DATA ANALYSIS PROJECT
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 25 08:58:46 2022
@author: Kirti Hora
"""
import pandas as pd
import matplotlib.pyplot as plt
# Main Menu
while(True):
print("Main Menu")
print("1. Fetch data")
print("2. Dataframe Statistics")
print("3. Display Records")
print("4. Working on Records")
print("5. Working on Columns")
print("6. Search specific row/column")
print("7. Data Visualization")
print("8. Data analystics")
print("9. Exit")
ch=int(input("Enter your choice"))
if ch==1:
result=pd.read_csv(r"D:\GRADE XII PYTHON\results.csv",index_col=0)
print(result)
elif ch==2:
while (True):
print("Dataframe Statistics Menu")
print("1. Display the Transpose")
print("2. Display all column names")
print("3. Display the indexes")
print("4. Display the shape")
print("5. Display the dimension")
print("6. Display the data types of all columns")
print("7. Display the size")
print("8. Exit")
ch2=int(input("Enter choice"))
result=pd.read_csv(r"D:\GRADE XII PYTHON\results.csv",index_col=0)
if ch2==1:
print(result.T)
elif ch2==2:
print(result.columns)
elif ch2==3:
print(result.index)
elif ch2==4:
print(result.shape)
elif ch2==5:
print(result.ndim)
elif ch2==6:
print(result.dtypes)
elif ch2==7:
print(result.size)
elif ch2==8:
break
elif ch==3:
while(True):
print("Display Records Menu")
print("1. Top 5 Resords")
print("2. Bottom 5 Records")
print("3. Specific number of records from the top")
print("4. Specific number of records from the bottom")
print("5. Details of a specific Subject")
print("6. Display details of all subjects")
print("7. Exit")
ch3=int(input("Enter choice"))
result=pd.read_csv(r"D:\GRADE XII PYTHON\results.csv",index_col=0)
if ch3==1:
print(result.head())
elif ch3==2:
print(result.tail())
elif ch3==3:
n=int(input("Enter how many records you want to display from the top"))
print(result.head(n))
elif ch3==4:
n=int(input("Enter how many records you want to display from the bottom"))
print(result.tail(n))
elif ch3==5:
st=input("Enter the subject name for which you want to see the details")
print(result.loc[st])
elif ch3==6:
print("Results of XYZ school for the session 2018-19")
print(result)
elif ch3==7:
break
elif ch==4:
while(True):
print("Working on Records Menu")
print("1. Insert a specific subject Detail")
print("2. Delete a specific subject Detail")
print("3. Update a specific subject detail")
print("4. Exit")
ch4=int(input("Enter choice"))
result=pd.read_csv(r"D:\GRADE XII PYTHON\results.csv",index_col=0)
if ch4==1:
a=input("Enter subject name")
b=int(input("Enter number of students appeared:"))
c=int(input("Enter highest marks obtained:"))
d=int(input("Enter average marks obtained"))
e=int(input("Enter number of A1's"))
f=int(input("Enter number of A2's"))
g=int(input("Enter percentage of A1 and A2's"))
h=int(input("Enter number of B1's"))
i=int(input("Enter number of B2's"))
j=int(input("Enter number of C1's"))
k=int(input("Enter number of C2's"))
l=int(input("Enter number of D's"))
m=int(input("Enter number of E's"))
result.loc[a]=[b,c,d,e,f,g,h,i,j,k,l,m]
print("Data successfully inserted")
elif ch4==2:
a=input("Enter subject name whose data needs to be deleted")
result.drop([a],inplace=True)
print("Data successfully deleted")
elif ch4==3:
a=input("Enter subject name whose data needs to be updated")
b=int(input("Enter number of students appeared:"))
c=int(input("Enter highest marks obtained:"))
d=int(input("Enter average marks obtained"))
e=int(input("Enter number of A1's"))
f=int(input("Enter number of A2's"))
g=int(input("Enter percentage of A1 and A2's"))
h=int(input("Enter number of B1's"))
i=int(input("Enter number of B2's"))
j=int(input("Enter number of C1's"))
k=int(input("Enter number of C2's"))
l=int(input("Enter number of D's"))
m=int(input("Enter number of E's"))
result.loc[a]=[b,c,d,e,f,g,h,i,j,k,l,m]
print("Data successfully updated")
elif ch4==4:
break
elif ch==5:
while(True):
print("Working on Columns Menu")
print("1. Insert a new column data")
print("2. Delete a specific column")
print("3. Exit")
ch5=int(input("Enter choice"))
result=pd.read_csv(r"D:\GRADE XII PYTHON\results.csv",index_col=0)
if ch5==1:
print("Enter details")
h=input("Enter column/heading name")
det=eval(input("Enter details corresponding to all subject:(enclosed in [ ])"))
result[h]=pd.Series(data=det,index=result.index)
print("Column inserted")
print(result)
elif ch5==2:
a=input("Enter column name which needs to be deleted")
result.drop([a],axis=1,inplace=False)
print("Column Temporary deleted")
elif ch5==3:
break
elif ch==6:
while(True):
print("Search Menu")
print("1. Search for the details of a specific subject")
print("2. Search details of a specific as per a specific column heading")
print("3. Exit")
ch6=int(input("Enter choice"))
result=pd.read_csv(r"D:\GRADE XII PYTHON\results.csv",index_col=0)
if ch6==1:
st=input("Enter the name of the subject whose details you want to see")
print(result.loc[st])
elif ch6==2:
col=input("Enter column/heading name whose details you want to see")
print(result[col])
elif ch6==3:
break
elif ch==7:
while(True):
print("Data Visualization Menu")
print("1. Line Plot")
print("2. Vertical Bar Plot")
print("3. Horizontal Bar Plot")
print("4. Histogram")
print("5. Exit")
ch7=int(input("Enter choice"))
result=pd.read_csv(r"D:\GRADE XII PYTHON\results.csv",index_col=0)
if ch7==1:
while(True):
print("Line Plot Sub Menu")
print("1. Subject wise Highest marks")
print("2. Subject wise number of students appeared")
print("3. Subject wise Average marks")
print("4. Subject wise comparison of percentage of A1 & A2")
print("5. Exit")
chline=int(input("Enter choice"))
if chline==1:
plt.plot(result.index,result['highest'],label="Highest Marks")
plt.title("SUBJECTWISE HIGHEST MARKS")
plt.xlabel("SUBJECTS")
plt.ylabel("HIGHEST MARKS")
plt.xticks(rotation=30)
plt.legend()
plt.grid(True)
plt.show()
elif chline==2:
plt.plot(result.index,result['appeared'],label="Number of students appeared")
plt.title("SUBJECTWISE NUMBER OF STUDENTS APPEARED")
plt.xlabel("SUBJECTS")
plt.ylabel("NUMBER OF STUDENTS")
plt.xticks(rotation=30)
plt.legend()
plt.grid(True)
plt.show()
elif chline==3:
plt.plot(result.index,result['average'],label="Average Marks obtained")
plt.title("SUBJECT WISE AVERAGE MARKS")
plt.xlabel("SUBJECTS")
plt.ylabel("AVERAGE MARKS")
plt.xticks(rotation=30)
plt.legend()
plt.grid(True)
plt.show()
elif chline==4:
plt.plot(result.index,result['per'],label="Percentage of A1 and A2")
plt.title("SUBJECT WISE PERCENTAGE OF A1 AND A2")
plt.xlabel("SUBJECTS")
plt.ylabel("PERCENTAGE OF A1 AND A2")
plt.xticks(rotation=30)
plt.legend()
plt.grid(True)
plt.show()
elif chline==5:
break
elif ch7==2:
while(True):
print("Vertical Bar Plot Sub Menu")
print("1. Subject wise Highest marks")
print("2. Subject wise number of students appeared")
print("3. Subject wise Average marks")
print("4. Subject wise comparison of percentage of A1 & A2")
print("5. Exit")
chbar=int(input("Enter choice"))
result=pd.read_csv(r"D:\GRADE XII PYTHON\results.csv",index_col=0)
if chbar==1:
plt.bar(result.index,result['highest'],label="Highest Marks", color="green")
plt.title("SUBJECTWISE HIGHEST MARKS")
plt.xlabel("SUBJECTS")
plt.ylabel("HIGHEST MARKS")
plt.xticks(rotation=30)
plt.legend()
plt.grid(True)
plt.show()
elif chbar==2:
plt.bar(result.index,result['appeared'],label="Number of students appeared",color="yellow")
plt.title("SUBJECTWISE NUMBER OF STUDENTS APPEARED")
plt.xlabel("SUBJECTS")
plt.ylabel("NUMBER OF STUDENTS")
plt.xticks(rotation=30)
plt.legend()
plt.grid(True)
plt.show()
elif chbar==3:
plt.bar(result.index,result['average'],label="Average Marks obtained",color="orange")
plt.title("SUBJECT WISE AVERAGE MARKS")
plt.xlabel("SUBJECTS")
plt.ylabel("AVERAGE MARKS")
plt.xticks(rotation=30)
plt.legend()
plt.grid(True)
plt.show()
elif chbar==4:
plt.bar(result.index,result['per'],label="Percentage of A1 and A2",color="green")
plt.title("SUBJECT WISE PERCENTAGE OF A1 AND A2")
plt.xlabel("SUBJECTS")
plt.ylabel("PERCENTAGE OF A1 AND A2")
plt.xticks(rotation=30)
plt.legend()
plt.grid(True)
plt.show()
elif chbar==5:
break
elif ch7==3:
while(True):
print("Horizontal Bar Plot Sub Menu")
print("1. Subject wise Highest marks")
print("2. Subject wise number of students appeared")
print("3. Subject wise Average marks")
print("4. Subject wise comparison of percentage of A1 & A2")
print("5. Exit")
chbar=int(input("Enter choice"))
if chbar==1:
plt.barh(result.index,result['highest'],label="Highest Marks", color="green")
plt.title("SUBJECTWISE HIGHEST MARKS")
plt.ylabel("SUBJECTS")
plt.xlabel("HIGHEST MARKS")
plt.legend()
plt.show()
elif chbar==2:
plt.barh(result.index,result['appeared'],label="Number of students appeared",color="yellow")
plt.title("NUMBER OF STUDENTS APPEARED")
plt.ylabel("SUBJECTS")
plt.xlabel("NUMBER OF STUDENTS")
plt.legend()
plt.show()
elif chbar==3:
plt.barh(result.index,result['average'],label="Average Marks obtained",color="orange")
plt.title("SUBJECT WISE AVERAGE MARKS")
plt.ylabel("SUBJECTS")
plt.xlabel("AVERAGE MARKS")
plt.legend()
plt.show()
elif chbar==4:
plt.barh(result.index,result['per'],label="Percentage of A1 and A2",color="green")
plt.title("SUBJECT WISE PERCENTAGE OF A1 AND A2")
plt.ylabel("SUBJECTS")
plt.xlabel("PERCENTAGE OF A1 AND A2")
plt.legend()
plt.show()
elif chbar==5:
break
elif ch7==4:
while(True):
print("Histogram Sub Menu [Showing 5 bins] ")
print("1. Highest marks")
print("2. Average Marks")
print("3. Percentagae of A1 and A2")
print("4. Exit")
chbar=int(input("Enter choice"))
result=pd.read_csv(r"D:\GRADE XII PYTHON\results.csv",index_col=0)
if chbar==1:
plt.hist(result['highest'],bins=5,label="Highest marks",
color="green",edgecolor="black")
plt.title("COUNT OF SUBJECTS FOR DIFFERENT RANGE OF HIGHEST MARKS ")
plt.xlabel("HIGHEST MARKS")
plt.ylabel("FREQUENCY")
plt.legend()
plt.show()
elif chbar==2:
plt.hist(result['average'],bins=5,label="Average Marks",color="yellow",edgecolor="black")
plt.title("COUNT OF SUBJECTS FOR DIFFERENT RANGE OF AVERAGE MARKS")
plt.xlabel("AVERAGE MARKS")
plt.ylabel("FREQUENCY")
plt.legend()
plt.show()
elif chbar==3:
plt.hist(result['per'],bins=5,label="Percentage of A1 & A2",color="orange",edgecolor="black")
plt.title("COUNT OF SUBJECTS FOR DIFFERENT RANGE OF PERCENTAGE OF A1 & A2")
plt.xlabel("PERCENTAGE OF A1 and A2")
plt.ylabel("FREQUENCY")
plt.legend()
plt.show()
elif chbar==4:
break
elif ch7==5:
break
elif ch==8:
while(True):
print("Data Analytics Menu")
print("1. Subject with maximum average marks")
print("2. Subject with minimum average marks")
print("3. Subject with maximum highest marks")
print("4. Subject with minimum highest marks")
print("5. Subject with maximum percentage of A1 and A2")
print("6. Subject with minimum percentage of A1 and A2")
print("7. Exit")
chana=int(input("Enter choice:"))
result=pd.read_csv(r"D:\GRADE XII PYTHON\results.csv",index_col=0)
if chana==1:
m=result['average'].max()
s=result.loc[result.average==m]
print("Subject with maximum average marks of ",m," is\n ",s.index)
elif chana==2:
m=result['average'].min()
s=result.loc[result.average==m]
print("Subject with minimum average marks of ",m," is\n ",s.index)
elif chana==3:
m=result['highest'].max()
s=result.loc[result.highest==m]
print("Subject with maximum highest marks of ",m," is\n ",s.index)
elif chana==4:
m=result['highest'].min()
s=result.loc[result.highest==m]
print("Subject with minimum highest marks of ",m," is\n ",s.index)
elif chana==5:
m=result['per'].max()
s=result.loc[result.per==m]
print("Subject with maximum percentage of A1 and A2",s.index,"\n Percentage being",m)
elif chana==6:
m=result['per'].min()
s=result.loc[result.per==m]
print("Subject with minimum percentage of A1 and A2",s.index,"\n Percentage being",m)
elif chana==7:
break
elif ch==9:
print("***********THANKS FOR USING*************")
break
Comments
Post a Comment