Fitness 3 18
Fitness 3 18
1 Acknowledgement 4
3 Introduction About 6
Python
5 CSV File 8
6 Source Code 9
7 Outputs 12
8 Bibliography 18
3
ACKNOWLEDGEMENT
4
ABOUT FITNESS CENTRE
4:Add a record
5: Modify a record
6: Delete a record
5
INTRODUCTION ABOUT PYTHON
Since 2003, Python has consistently ranked in the top ten most popular
programming languages in the TIOBE Programming Community Index where, as
of February 2021, it is the third most popular language (behind Java, and C). It
was selected Programming Language of the Year in 2007, 2010, 2018, and 2020 .
6
SYSTEM REQUIREMENTS
Hardware Requirements:
Software Requirements:
7
CSV FILE
8
SOURCE CODE
import pandas as pd
import matplotlib.pyplot as plt
df=pd.read_csv("fitness.csv")
choice='y'
while choice=='y':
print('1:show all record')
print('2:display name and fees of given gid')
print('3:display name of a trainees under a particular fees')
print('4:add a record')
print('5:modify a record')
print('6:delete a record')
print('7:show height chart using bargraph')
print('8:show weight chart using line chart')
print('9:bargraph of name vs weight')
print('10:save data into csv file')
ch=eval(input("enter your choice"))
if ch==1:
print(df)
elif ch==2:
b=int(input('gid'))
for i in range(len(df)):
if df.iloc[i][0]==b:
print(df.iloc[i][1],df.iloc[i][6])
elif ch==3:
g=int(input("fees"))
for i in range(len(df)):
if df.iloc[i][6]==g:
9
print(df.iloc[i][1])
elif ch==4:
n=int(input("enter gid:"))
i=input("enter name:")
a=input("enter age:")
g=input("enter weight:")
q=input("enter height:")
p=input("enter trainer:")
o=eval(input("enter fees:"))
df.loc[10]=[n,i,a,g,q,p,o]
print(df)
elif ch==5:
z=int(input("enter gid to modify:"))
f=int(input("enter new fees:"))
for i in range(len(df)):
if df.iloc[i][0]==z:
df.iat[i,6]=f
print("modified")
break
else:
print("not present")
elif ch==6:
print(df)
i=int(input("enter the index number :"))
df=df.drop(i,axis=0)
print(df)
elif ch==7:
x=df["name"]
y=df["height"]
10
plt.title("name vs height")
plt.bar(x,y,color=['g','r','b','k','m','c','y','g','r'])
plt.xlabel('name')
plt.ylabel('height')
plt.show()
elif ch==8:
x=df["name"]
y=df["weight"]
plt.plot(x,y)
plt.xlabel("name")
plt.ylabel("weight")
plt.show()
elif ch==9:
x=df["name"]
y=df["weight"]
plt.title('name vs weight')
plt.bar(x,y,color=['g','r','b','k','m','c','y','g','r'])
plt.xlabel('name')
plt.ylabel('weight')
plt.show()
elif ch==10:
df.to_csv("fitness.csv",index=False)
print("FILE SAVED")
choice=input("do you want to continue,press y:")
else:
print("PROGRAM FINISHED")
11
OUTPUTS
CHOICE 1:
12
CHOICE 2 :
CHOICE 3 :
13
CHOICE 4 :
14
CHOICE 5:
CHOICE 6:
15
CHOICE 7:
CHOICE 8:
16
CHOICE 9:
CHOICE 10:
17
BIBLIOGRAPHY/REFERENCES
https://www.python.org/
https://www.wikipedia.org/
https://cbse.nic.in/
18