bmigraph.exercise_plan

Module Contents

Functions

exercise_plan(weight, height, sex, age, target_weight, ...)

Create an exercise plan based on current weight, height, age and target

bmigraph.exercise_plan.exercise_plan(weight, height, sex, age, target_weight, number_of_days, return_graph=False)[source]

Create an exercise plan based on current weight, height, age and target BMI.

The calorie consumption needed each day is computed and a set of activities is suggested accordingly. If return_graph is True, a plotly.graph_objects.Figure object instead of a dictionary.

Parameters:
  • weight (float) – Weight, in kilograms.

  • height (float) – Height, in meters.

  • sex (int) – Sex, used in the Harris–Benedict equation estimation, 1 for male and 2 for female.

  • age (int) – Current age, in years.

  • target_weight (float) – Target weight, in kilograms.

  • number_of_days (int) – Number of days to reach the target weight.

  • return_graph (bool) – Whether to return a graph instead of a dictionary.

Returns:

If return_graph is False, we get a dictionary with key to be different exercises, and the value to be number of minutes (rounded to nearest integer) needed for that activity. Note that each of the activities are associated as an “or”. If return_graph is True, we get a plotly.graph_objects.Figure instead that can be saved or shared.

Return type:

dict or plotly.graph_objects.Figure

Examples

>>> exercise_plan(100, 1.83, 2, 27, 68, 30)
>>> {'Leisure cycling or walking': 213,
>>> 'Moderate rope-jumping': 88,
>>> 'General running': 112,
>>> 'Leisure swimming': 156}