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

BRAIN INTERNATIONAL

SCHOOL
SESSION 2023-24

SUBMITTED BY : Manpreet Kaur Vedi


ROLL NO. :
CERTIFICATE
The project work titled “Diet Management”, submitted by
Manpreet Kaur Vedi & Gurpreet Kaur Bhatia, students of
Class XII Brain International School is completed under my
supervision. Proper care and utmost sincerity have been taken in
the completion of the project. I certify that the project is up to
the expectations and guidelines issued by CBSE.

Principal’s Signature Teacher’s Signature


ACKNOWLEDGEMENT

I hereby express our sincere thanks to our respected computer

teacher who gave us valuable suggestions, guidance and

assistance in successful completion of this project.

Manpreet Kaur Vedi

Gurpreet Kaur Bhatia


INDEX
S.No. TOPIC Teacher’s
Signature
1. INTRODUCTION

2. CSV FILE STRUCTURE

3. CODING OF PROJECT

4. OUTPUT OF PROJECT

5. BIBLIOGRAPHY

INTRODUCTION
Details about the project topic with the name of
the modules created

CSV STRUCTURE
CSV Name :
CSV Screenshots:
CODING OF THE PROJECT
import pandas as pd
import matplotlib.pyplot as plt
df=pd.read_csv("Book1.csv")
print(df)
print("-----------------------------------------------------------------------------")
for a in range(0,7):
print("MENU")
print("1.READING A FILE")
print("2.DATAFRAME ANALYSIS")
print("3.DATAFRAME STATISTICS")
print("4.COLUMN")
print("5.ROW")
print("6.DATA VISUALISATION")
ch=int(input("Enter choice(1/2/3/4/5/6): "))
if ch==1:
print("--------------------------Reading a file--------------------------")
print(df)
elif ch==2:
print("--------------------------Dataframe Analysis Menu--------------------------")
print("2.1.MAXIMUM AGE")
print("2.2.MINIMUM AGE")
print("2.3.MAXIMUM HEIGHT")
print("2.4.MINIMUM HEIGHT")
print("2.5.MAXIMUM WEIGHT")
print("2.6.MINIMUM WEIGHT")
for b in range(0,6):
ch1=float(input("Enter choice(2.1/2.2/2.3/2.4/2.5/2.6): "))
if ch1==2.1:
print("---------------Maximum Age---------------")
print(df.aggregate({"Age":['max']}))
elif ch1==2.2:
print("---------------Minimum Age---------------")
print(df.aggregate({"Age":['min']}))
elif ch1==2.3:
print("---------------Maximum Height---------------")
print(df.aggregate({"Height":['max']}))
elif ch1==2.4:
print("---------------Minimum Height---------------")
print(df.aggregate({"Height":['min']}))
elif ch1==2.5:
print("---------------Maximum Weight---------------")
print(df.aggregate({"Weight(in kg)":['max']}))
else:
print("---------------Minimum Weight---------------")
print(df.aggregate({"Weight(in kg)":['min']}))
elif ch==3:
print("--------------------------Dataframe Statistics Menu--------------------------")
print("3.1.DISPLAY TOP 10 RECORDS")
print("3.2.DISPLAY BOTTOM 10 RECORDS")
print("3.3.DISPLAY DATATYPE")
print("3.4.DISPLAY SIZE")
print("3.5.DISPLAY ALL ROWS AND COLUMNS")
print("3.6.DISPLAY TRANSPOSE INDEX")
for c in range(0,6):
ch3=float(input("Enter choice(3.1/3.2/3.3/3.4/3.5/3.6): "))
if ch3==3.1:
print("---------------Top 10 Records---------------")
print(df.head(10))
elif ch3==3.2:
print("---------------Bottom 10 Records---------------")
print(df.tail(10))
elif ch3==3.3:
print("---------------Datatype---------------")
print(df.dtypes)
elif ch3==3.4:
print("---------------Size---------------")
print(df.size)
elif ch3==3.5:
print("---------------All Rows and Columns---------------")
print(df)
else:
print("---------------Transpose Index---------------")
print(df.T)
elif ch==4:
print("--------------------------Column Menu--------------------------")
print("4.1.INSERT A NEW COLUMN")
print("4.2.DELETE A COLUMN")
for d in range(0,2):
ch4=float(input("Enter choice(4.1/4.2): "))
if ch4==4.1:
name=str(input("Name of new column:"))
values=str(input("Enter values:"))
df.loc[:,name]=values
print(df)
print("---------------Column Added---------------")
else:
del df['Blood Grp.']
print(df)
print("---------------Column Deleted---------------")
elif ch==5:
print("--------------------------Row Menu--------------------------")
print("5.1.INSERT A NEW ROW")
print("5.2.DELETE A ROW")
for e in range(0,2):
ch5=float(input("Enter choice(5.1/5.2): "))
if ch5==5.1:
df.loc[20,:]=[20,'Akash',39,'M','5.7 feet',95,'Veg',9911369146,'Weight loss','A+']
print(df)
print("---------------Row Added---------------")
else:
df=df.drop(20)
print(df)
print("---------------Row Deleted---------------")
else:
print("--------------------------Data Visualization Menu--------------------------")
print("6.1.LINE CHART")
print("6.2.BAR GRAPH")
print("6.3.HISTOGRAM")
for f in range(0,3):
ch6=float(input("Enter choice(6.1/6.2/6.3): "))
if ch6==6.1:
OUTPUT
BIBLIOGRAPHY

You might also like