Skip to content

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

The Data

I have been 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 libraries to play with
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Create Dataframes from csv files
workout = pd.read_csv('workout.csv')
three_keywords = pd.read_csv('three_keywords.csv')
workout_geo = pd.read_csv('workout_geo.csv')
three_keywords_geo = pd.read_csv('three_keywords_geo.csv')
# Preview function for dataframes
def preview(df):
    print(df.shape)
    print(df.info())
# Preview
preview(workout)
# Sort by year and count total worldwide workouts
workout['year'] = [x[:4] for x in workout['month']]
workout_year = workout.groupby('year', as_index=False)[['workout_worldwide']].sum()
# Visualize keyword workout searches across the globe
sns.barplot(data=workout_year, x='year', y='workout_worldwide')
plt.title('Global Workout Keyword Seaches')
plt.xlabel('Year')
plt.ylabel('Number of Searches')
sns.set_style('whitegrid')
plt.show()
# Filter for year with highest workout keyword searches online
workout_year_sorted = workout_year.sort_values(by='workout_worldwide', ascending=False)
year_str = workout_year_sorted['year'].values[0]
# View Results
print(year_str)

It looks like physical fitness and workout searches online plummeted during the Covid-19 Pandemic.

# Preview
preview(three_keywords)
# Sort by year and sum between different keywords
three_keywords['year'] = [x[:4] for x in three_keywords['month']]
keywords_year = three_keywords.groupby('year', as_index=False)[['home_workout_worldwide', 'gym_workout_worldwide', 'home_gym_worldwide']].sum()
# Vizualize trends between different keyword seaches
fig = plt.figure()

line1 = sns.lineplot(data=keywords_year, x='year', y='home_workout_worldwide', marker='o', label='Home/Workout')
line2 = sns.lineplot(data=keywords_year, x='year', y='gym_workout_worldwide', marker='o', label='Gym/Workout')
line3 = sns.lineplot(data=keywords_year, x='year', y='home_gym_worldwide', marker='o', label='Home/Gym')

plt.title('Specific Workout Keyword Seaches')
plt.xlabel('Year')
plt.ylabel('Number of Searches')
sns.set_style('whitegrid')
fig.legend(handles=[line1, line2, line3])
plt.show()
# Keyword trends
peak_covid = 'home_workout_worldwide'
current = 'gym_workout_worldwide'