Open In App

Calculate Bodyfat Percentage with skinfold measurements using Python

Improve
Improve
Like Article
Like
Save
Share
Report

Fitness is Important for everyone. Children and adults of all ages need regular physical activity. Physical activity promotes good health, and you can be always active at any age. Let write python scripts to help them to calculate their bodyfat percentage. Bodyfat Percentage can be calculated with skinfold measurements (Calipers). Caliper is a device in which you can measure skin folds of triceps, biceps, suprailiac, thigh, and puts those measurements into a formula.

We are going to use the fitness-tools module to calculate body fat percentage. Before starting we need to install the fitness-tools module:

Installation

This module does not come built int with Python. To install this type the below command in the terminal.

pip install fitness-tools

Method 1: 

Consider a 25-year-old female whose skinfold measurements in millimeters are:

triceps = 5
biceps = 7
thigh = 8
suprailiac = 12

Approach:

  • Import module
  • pass the following arguments to DurninWomersley(Age, Sex, Askinfold measurements)
  • Get body density value with body_density()
  • Get  bodyfat  with siri()

Below is the implementation:

Python3




from fitness_tools.composition.bodyfat import DurninWomersley
 
 
data = DurninWomersley(25, 'female', (5, 7, 8, 12))
data.body_density()


 Output: 

1.0519807465544626

Get the body fat 

Python3




# pass the body density value to a
# bodyfat equation inherited from
# GenericCalculator
data.siri(data.body_density())


 
Output: 

20.5

Note: According to the Durnin Womersley equation, our hypothetical female’s body fat is 20.5%.

Method 2: We can use JacksonPollock4Site class to get direct data from the given measurement. 

Python3




from fitness_tools.composition.bodyfat import JacksonPollock4Site
 
 
data = JacksonPollock4Site(20, 'male', (7, 8, 6, 7))
 
# Calculates bodyfat directly
data.body_fat()


Output: 

5.2

Note: According to the JacksonPollock4Site equation, the hypothetical male has a body fat percent of 5.2%.

 



Last Updated : 10 Jun, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads