Skip to content

You are a product manager for a fitness studio and are interested in understanding the current demand for digital fitness classes. You plan to conduct a market analysis in Python to gauge demand and identify potential areas for growth of digital products and services.

The Data

You are provided with a number of CSV files in the "Files/data" folder, which offer international and national-level data on Google Trends keyword searches related to fitness and related products.

workout.csv

ColumnDescription
'month'Month when the data was measured.
'workout_worldwide'Index representing the popularity of the keyword 'workout', on a scale of 0 to 100.

three_keywords.csv

ColumnDescription
'month'Month when the data was measured.
'home_workout_worldwide'Index representing the popularity of the keyword 'home workout', on a scale of 0 to 100.
'gym_workout_worldwide'Index representing the popularity of the keyword 'gym workout', on a scale of 0 to 100.
'home_gym_worldwide'Index representing the popularity of the keyword 'home gym', on a scale of 0 to 100.

workout_geo.csv

ColumnDescription
'country'Country where the data was measured.
'workout_2018_2023'Index representing the popularity of the keyword 'workout' during the 5 year period.

three_keywords_geo.csv

ColumnDescription
'country'Country where the data was measured.
'home_workout_2018_2023'Index representing the popularity of the keyword 'home workout' during the 5 year period.
'gym_workout_2018_2023'Index representing the popularity of the keyword 'gym workout' during the 5 year period.
'home_gym_2018_2023'Index representing the popularity of the keyword 'home gym' during the 5 year period.
# Import the necessary libraries
import pandas as pd
import matplotlib.pyplot as plt

# Read files using Pandas
workouts = pd.read_csv('data/workout.csv')
three_keywords = pd.read_csv('data/three_keywords.csv')
workout_geo = pd.read_csv('data/workout_geo.csv')
three_keywords_geo = pd.read_csv('data/three_keywords_geo.csv')
# Start coding here
# Subset where popularity is max score
year_month = workouts[workouts['workout_worldwide'] == workouts['workout_worldwide'].max()]
print(year_month)
# Convert to string and format for year
year_str = '2020'
print(year_str)
# Graph keywords data
ax = three_keywords.plot(x = 'month', y = 'home_workout_worldwide', kind = 'line', label = 'home workout')
ax2 = three_keywords.plot(x = 'month', y = 'gym_workout_worldwide', kind = 'line', label = 'gym workout', ax = ax)
ax3 = three_keywords.plot(x = 'month', y = 'home_gym_worldwide', kind = 'line', label = 'home gym', ax = ax)
plt.show()

# Split data into covid and current
covid_era = three_keywords[three_keywords['month'] <= '2022-05']
current_time = three_keywords[three_keywords['month'] > '2022-05']

# Confirm covid-era max value
covid_era.max()
peak_covid = 'home workout'

# Confirm current time max value
current_time.max()
current = 'gym workout'
# Subset USA, Australia, Japan countries from dataset
top_three = workout_geo['country'].isin(['United States', 'Australia', 'Japan'])
workout_geo[top_three]

# Sort values from highest to lowest popularity
sorted_top_three = workout_geo[top_three].sort_values(by = 'workout_2018_2023', ascending = False)
print(sorted_top_three.head())

top_country = 'United States'
print(top_country)
# Subset Philipines and Malaysia from dataset
phili_malay = three_keywords_geo['Country'].isin(['Philippines', 'Malaysia'])
phili_malay_home_workout = three_keywords_geo[phili_malay][['Country', 'home_workout_2018_2023']]

# Find higher interest for home workouts
higher_interest = phili_malay_home_workout[phili_malay_home_workout['home_workout_2018_2023'] == phili_malay_home_workout['home_workout_2018_2023'].max()]
print(higher_interest.head())

home_workout_geo = 'Philippines'
print(home_workout_geo)
workouts.head()
three_keywords.head()
workout_geo.head()
three_keywords_geo.head()