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.

Libraries import

import pandas as pd
import matplotlib.pyplot as plt

Q1: When was the global search for 'workout' at its peak?

# read csv
df = pd.read_csv('data/workout.csv')

# show first rows
df.head()
# check df data types
df.dtypes
#sort df by workout desc
df_sorted = df.sort_values(by='workout_worldwide', ascending=False)

# take the first row and extract the first 4 characters
year_str= df_sorted.iloc[0]['month'][:4]

print(f"The year where the global search for 'workout' was at its peak was {year_str}.")

Q2: Of the keywords available, what was the most popular during the covid pandemic, and what is the most popular now?

# read three_keywords csv
keyword_df = pd.read_csv('data/three_keywords.csv')

# show first rows
keyword_df.head()
# check data types
keyword_df.dtypes
# convert month to datetime
keyword_df['month'] = pd.to_datetime(keyword_df['month'])

# set month as index
keyword_df.set_index('month', inplace=True)

# plot data
keyword_df.plot(figsize=(12, 6))
plt.title('Search Trends for Workout Keywords')
plt.xlabel('Month')
plt.ylabel('Search Interest')
plt.legend(title='Keywords')
plt.show()
# assign top keyword to variable
peak_covid = 'home_workout'
current = 'gym_workout'

print(f"During Covid the most popular keyword was {peak_covid} and the current is {current}.")

Q3: What country has the highest interest for workouts among the following: United States, Australia, or Japan?

# read workout_geo csv
geo_df = pd.read_csv('data/workout_geo.csv')

# show first rows
geo_df.head()