All our Data Science projects include bite-sized activities to test your knowledge and practice in an environment with constant feedback.
All our activities include solutions with explanations on how they work and why we chose them.
To analyze exercise habits across different age groups, we need to categorize the Age
column into meaningful groups. Create three age categories:
0-30
30-60
60
Store the result in a new column called AgeGroup
. The output should resemble the provided example series.
To analyze exercise habits across different weight ranges, we need to categorize the Actual Weight into meaningful groups. Create three weight categories:
0-60
60-80
80
Store the result in a new column called WeightCategory
. The output should resemble the provided example series.
In this activity, we want to categorize exercise durations into three meaningful groups: Sedentary, Moderate, and Active. By doing this, we can analyze exercise habits across different duration ranges such as 0, 25, 50, and inf.
Here are the steps to complete the task:
ExerciseLevel
.Categorize each exercise duration according to the following ranges:
Store the categorization result in the ExerciseLevel
column.
The output should resemble the provided example series.
Generate dummy variables for the Gender
column and store the result in the variable gender_dummies
. Each variable should be prefixed with Gender
using a colon :
separator.
Note: The resulting dataframe should resemble the example shown below:
Create dummy variables for the "Weather Conditions" column. Each variable should be prefixed with "Weather:" and separated by a colon ":". Make sure to drop the first categorical level, but keep it as a level if the row has 0 in all categorical levels.
Store the resulting dummy variables in the variable Weather_dummies
.
Note: The resulting dataframe should resemble the example given below:
Create a new column called ExerciseIntensityCategory
to categorize the exercises into four intensity levels:
(0-0.25)
, (0.25-0.50)
,(0.50-0.75)
,(0.75-1)
based on their exercise intensity values. Assign each exercise to an appropriate intensity level using the quantiles 0
, 0.25
, 0.5
, 0.75
, and 1
.
Note: Ensure that the resulting column matches the provided example series shown in the image:
Create a new column called CalorieBurnCategory
and assign each exercise to one of three categories based on the CaloriesBurn
column:
You should use 3 quantiles to determine the category boundaries. Store the category labels in the calorie_burn_bin_edges
variable.
Note: Your results should look similar to this image:
Create a new column called BMICategory
to categorize exercises as Underweight
, Normal Weight
, or Overweight
based on their BMI. Use 3 quantiles to define the categories. Store the bin edges in the variable bmi_bin_edges
.
Note: Your results should look similar to this image:
Create a new column called HeartRateZone
and categorize the exercises based on their Heart rate
into the Resting Zone,
Fat-Burning Zone,
or Cardio Zone
. Use three quantiles to define the categories. Store the bin edges in the variable heart_rate_bin_edges
Note: Your results should look similar to this image:
Calculate the average Exercise Intensity
for each BMICategory
and store the result in the variable bmi_exercise_frequency
. This analysis will help us understand the relationship between BMI and exercise intensity or fitness metrics.
Notes:
Please ensure that you have completed Activity 8 before attempting this activity.
Your result should look similar to this series:
Store the resulting chart in the variable calories_exercises_count_chart
& the grouped data in the variable exercises_count_data
.
Notes:
Make sure to pass activity 7 first before you try this activity.
It should be a stacked bar chart with figure size of (10, 6)
.
Your result should look similar to this chart: