IP Final Project 1
IP Final Project 1
SYSTEM
A BMI Management System is a tool or process designed to monitor,
evaluate, and guide individuals in maintaining a healthy Body Mass Index
(BMI). BMI is a measure that uses a person's weight and height to estimate
whether their body weight falls within a healthy range. The system can be
used by individuals, health professionals, or organizations to promote
better health and fitness outcomes.
1. Data Collection:
Users input personal information such as weight, height, age, and gender.
2. BMI Calculation:
Based on the calculated BMI, the system categorizes the individual into
different health ranges:
6. Progress Monitoring:
Regular tracking of BMI changes over time to assess progress and refine
strategies.
PYTHON
Python is a versatile, high-level, and interpreted programming language
that is widely used for various applications, from web development to data
science and artificial intelligence. Created by Guido van Rossum in 1991,
Python is known for its simplicity, readability, and extensive libraries,
making it one of the most popular programming languages in the world.
Key Features of Python:
1. Easy to Learn and Use: Python has a simple and intuitive syntax that
resembles natural language, making it beginner-friendly
2. Interpreted Language: Python does not need to be compiled; instead,
it is executed line by line, allowing for quick debugging and testing.
3. Open-Source: Python is free to use, distribute, and modify, supported
by a large global community
4. Versatile: Python supports multiple programming paradigms,
including:
Functional Programming
Procedural Programming
Applications of Python:
1. Web Development: Frameworks like Django and Flask are used to
create robust and scalable web applications.
2. Data Science and Analytics: Python is a favorite among data
scientists due to libraries like Pandas, NumPy, and Matplotlib.
3. Machine Learning and AI: Tools like TensorFlow and PyTorch help build
intelligent systems and predictive models.
4. Automation: Python is widely used for scripting and automating
repetitive tasks.
5. Game Development: Libraries like Pygame allow for simple game
development
6. Cybersecurity: Python helps in building tools for ethical hacking,
penetration testing, and network analysis.
MYSQL
Introduction to MySQL
MySQL is an open-source, relational database management system
(RDBMS) that is widely used for storing, managing, and retrieving
structured data. It was developed by MySQL AB in 1995 and is now
maintained by Oracle Corporation. MySQL is renowned for its reliability,
speed, and ease of use, making it a preferred choice for both small-scale
and large-scale applications
Applications of MySQL:
Benefits of MySQL:
User-Friendly: Easy to learn and use, even for beginners.
PANDAS LIBRARY
Pandas is a Python library used for data manipulation, analysis, and
cleaning. It provides efficient data structures and operations for working
with structured data, such as tables or time-series data. It is widely used in
data science and machine learning projects.
MATPLOTLIB
Matplotlib is a Python library used for data visualization. It provides
tools to create a variety of static, interactive, and animated plots.
Key Points:
Line plots
Scatter plots
Bar charts
Histograms
Pie charts
3D plots
NUMPY LIBRARY
Key Features:
1. N-dimensional Arrays: Provides the ndarray object for efficient storage
and manipulation of large datasets.
While True:
Print(‘\t\t *** Body Mass Index Project *** ‘)
Print(‘Body mass index (BMI) is a measure of body fat
based on height and weight that applies to adult men
and women. View the BMI tables or use the tool below to
compute yours.Enter your weight and height using
standard or metric measures ‘)
Print(‘\n\t\t\t1. Data Analysis’)
Print(‘\n\t\t\t2. Data Visualization’)
Print(‘\n\t\t\t3. Data Operations’)
Print(‘\n\t\t\t4. Exit\n’)
If choice==1:
While True:
Print(‘\t*** BODY MASS INDEX SYSTEM ***\n’)
Print(‘*’*50)
Print(“\n\t\t1. Show BMI Data”)
Print(“\n\t\t2. Show Name Wise-Data”)
Print(‘\n\t\t3. Show first nth record’)
Print(“\n\t\t4. Show last nth records”)
Print(“\n\t\t5. Display the Names Who are
UNDER WEIGHT”)
Print(‘\n\t\t6. Display the Names Who are
OVER WEIGHT’)
Print(“\n\t\t7. For Exit the program\n\n”)
Choice = int(input(“Enter Your Choice [1-7] :
“))
If choice == 1:
Print(“\nEmployees Data :\n\n”)
Df=pd.read_csv(‘F:\\projects\\IP_BMI\\
bmi.csv’)
Print(tabulate(df,showindex=False,header
s=[‘Year’,’AadharNo’,’Name’,’Age’,’Height in
meter’,’Weight in KG’,’BMI’,’Standard Min
Value’,’Standard Max
Value’,’Remark’],tablefmt=’preety’))
Elif choice == 2:
Print(“\nData Name- Wise Data :\n”)
Df=pd.read_csv(‘F:\\projects\\IP_BMI\\
bmi.csv’,usecols = [‘Name’,’Age’,’Height in
meter’,’Weight in KG’,’BMI’,’Standard Min
Value’,’Standard Max Value’,’Remark’])
Df = df.sort_values(by=’Name’)
Print(tabulate(df,showindex=False,header
s=[‘Name’,’Age’,’Height in meter’,’Weight in
KG’,’BMI’,’Standard Min Value’,’Standard Max
Value’,’Remark’],tablefmt=’pretty’))
Elif choice == 3:
Print(“\nFirst N Rows \n”)
Df=pd.read_csv(‘F:\\projects\\IP_BMI\\
bmi.csv’)
Df = df.sort_values(by=’Name’)
Nth = int(input(“How many rows to
display? : “))
Print(tabulate(df.head(nth),showindex=Fal
se,headers=[‘Year’,’AadharNo’,’Name’,’Age’,’Height in
meter’,’Weight in KG’,’BMI’,’Standard Min
Value’,’Standard Max
Value’,’Remark’],tablefmt=’pretty’))
Elif choice == 4:
Print(“\nLast N Rows \n”)
Df=pd.read_csv(‘F:\\projects\\IP_BMI\\
bmi.csv’)
Df = df.sort_values(by=’Name’)
Nth = int(input(“How many rows to
display? : “))
Print(tabulate(df.tail(nth),showindex=Fals
e,headers=[‘Year’,’AadharNo’,’Name’,’Age’,’Height in
meter’,’Weight in KG’,’BMI’,’Standard Min
Value’,’Standard Max
Value’,’Remark’],tablefmt=’pretty’))
Elif choice == 5:
Print(“\nNames Who are Under Weight :\
n”)
Df=pd.read_csv(‘F:\\projects\\IP_BMI\\
bmi.csv’)
Mask = df.loc[df[‘Remark’] == ‘Under
Weight’]
#underweight=df[mask]
Print(tabulate(mask,showindex=False,hea
ders=[‘Year’,’AadharNo’,’Name’,’Age’,’Height in
meter’,’Weight in KG’,’BMI’,’Standard Min
Value’,’Standard Max
Value’,’Remark’],tablefmt=’pretty’))
Elif choice==6:
Print(“\nNames Who are Over Weight :\n”)
Df=pd.read_csv(‘F:\\projects\\IP_BMI\\
bmi.csv’)
Mask = df.loc[df[‘Remark’] ==’Over
Weight’ ]
Print(tabulate(mask,showindex=False,hea
ders=[‘Year’,’AadharNo’,’Name’,’Age’,’Height in
meter’,’Weight in KG’,’BMI’,’Standard Min
Value’,’Standard Max
Value’,’Remark’],tablefmt=’pretty’))
Elif choice==7:
Print(‘Exit to main menu…………’)
Break
Else:
Print(‘Invalid Choice, Retry 1/2/3/4/5/6/7’)
Elif choice==2:
While True:
Print(‘Data Visualization’)
Print(‘\n\t1. Plot Line Chart (Name and Base
MASS Index’)
Print(‘\n\t2. Plot Bar Chart Vertical (Name and
BMI)’)
Print(‘\n\t3. Plot Bar Horizontal Chart (Name
and BMI)’)
Print(‘\n\t4. Plot Histogram (Name and BMI y)’)
Print(‘\n\t5. Exit\n’)
Choic=int(input(‘Select your Choice [1-4] : ‘))
If choic==1:
Print(‘Line Chart’)
Df=pd.read_csv(‘F:\\projects\\IP_BMI\\
bmi.csv’)
NAME=df[“Name”]
BMI=df[“BMI”]
Plt.plot(NAME,BMI, color=’r’)
Plt.grid()
Plt.savefig(‘bmi_line.pdf’)
Plt.show()
Elif choic==2:
Print(‘Bar Chart’)
Df=pd.read_csv(‘F:\\projects\\IP_BMI\\
bmi.csv’)
NAME=df[“Name”]
BMI=df[“BMI”]
Plt.ylabel(“BMI”)
Plt.bar(NAME,BMI, color=’r’)
Plt.grid()
Plt.savefig(‘bmi_bar.pdf’)
Plt.show()
Elif choic==3:
Print(‘Bar Chart’)
Df=pd.read_csv(‘F:\\projects\\IP_BMI\\
bmi.csv’)
NAME=df[“Name”]
BMI=df[“BMI”]
Elif choic==4:
Print(‘Histogram’)
Df=pd.read_csv(‘F:\\projects\\IP_BMI\\
bmi.csv’)
NAME=df[“Name”]
BMI=df[“BMI”]
Plt.hist(BMI, color=’r’)
Plt.grid()
Plt.savefig(‘bmi_hist.pdf’)
Plt.show()
Elif choic==5:
Print(‘Exit to main menu……..’)
Break
Else:
Print(‘Invalid choice’)
Elif choice==3:
While True:
Print(‘Data Operations’)
Print(‘\n\t1. Add a new record in BMI List’)
Print(‘\n\t2. Remove a existing record from
List’)
Print(‘\n\t3. Exit\n’)
Choic=int(input(‘Select your Choice [1-3] : ‘))
If choic==1:
Df=pd.read_csv(‘F:\\projects\\IP_BMI\\
bmi.csv’)
NAME= input(‘Enter Name : ‘)
AADHARNO= input(‘Enter Aadhar
Number : ‘)
AGE = input(‘Enter Age : ‘)
WEIGHT= float(input(‘Enter Weight in
Kilograms(Kg) : ‘))
HEIGHT= float(input(‘Enter Height in
Meters : ‘))
BMI= WEIGHT/(HEIGHT*HEIGHT)
If(BMI<18.5): REMARK = “Under Weight”
Elif(BMI>24.9) : REMARK= “Over Weight”
Else: REMARK = “Standard Value”
Record=df[‘Name’].count()
Df1=pd.DataFrame({“Year”:2023,”Aadhar
No”:AADHARNO,”Name”:NAME,”Age”:AGE,”Height in
meter” : HEIGHT, “Weight in KG” : WEIGHT,
“BMI” : BMI , “Standard Min
Value” : 18.5, “Standard Max
Value”:24.9,”Remark”:REMARK}, index=[record])
Df=pd.concat([df,df1], ignore_index=True)
Print(tabulate(df,showindex=False,headers
=[‘Year’,’AadharNo’,’Name’,’Age’,’Height in
meter’,’Weight in KG’,’BMI’,’Standard Min
Value’,’Standard Max
Value’,’Remark’],tablefmt=’pretty’))
Df.to_csv(‘F:\\projects\\IP_BMI\\bmi.csv’,
index=False)
Print(‘Record added Successfully…………..’)
Elif choic==2:
Df=pd.read_csv(‘F:\\projects\\IP_BMI\\
bmi.csv’)
Print(tabulate(df,showindex=False,headers
=[‘Year’,’AadharNo’,’Name’,’Age’,’Height in
meter’,’Weight in KG’,’BMI’,’Standard Min
Value’,’Standard Max
Value’,’Remark’],tablefmt=’pretty’))
Elif choic==3:
Print(‘Exit to main menu……..’)
Break
Else:
Print(‘Invalid choice’)
Elif choice==4:
Print(‘Exit from menu……..’)
Break
Else:
Print(‘Invalid choice’)
output
1. Data analysis
ops.
4. Exit
"Era-IT
p Type to
:
EnterYourChoice(1-71 5
2.Data visualization.
Mohit
Gnha
Ram
dheRadhe 20 30
BASE MASS Index
Plot histogram
1.75
1.50
1.25
1.00
0.75
0.50
0.25
0.00
Data operation
1