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

When was the global search for 'workout' at its peak? Save the year of peak interest as a string named year_str in the format "yyyy".


workout = pd.read_csv("data/workout.csv")

workout.head()
workout['year'] = workout['month'].str.split('-', expand=True)[0].astype(int)

workout.head()
plt.plot( workout['year'],workout['workout_worldwide'])
plt.show()
max_year = workout.groupby('year')['workout_worldwide'].sum()

year_str = max_year.idxmax().astype(str)
year_str

Of the keywords available, what was the most popular during the covid pandemic, and what is the most popular now? Save your answers as variables called peak_covid and current respectively.

three_key = pd.read_csv('data/three_keywords.csv')
three_key.head()
three_key['year'] = three_key['month'].str.split('-', expand = True)[0].astype(int)
three_key.head()

fig, ax = plt.subplots(3, 1, figsize=(10, 12), sharex=True)

ax[0].plot(three_key['year'], three_key['home_workout_worldwide'], color='teal')
ax[0].set_title('Home Workouts Worldwide')

ax[1].plot(three_key['year'], three_key['gym_workout_worldwide'], color='tomato')
ax[1].set_title('Gym Workouts Worldwide')

ax[2].plot(three_key['year'], three_key['home_gym_worldwide'], color='orchid')
ax[2].set_title('Home + Gym Workouts Worldwide')

for axis in ax:
    axis.set_ylabel('Workout Count')

ax[2].set_xlabel('Year')
plt.tight_layout()
plt.show()
peak_covid = 'home workout'
current = 'gym workout'

What country has the highest interest for workouts among the following: United States, Australia, or Japan? Save your answer as top_country.

wk_geo = pd.read_csv('data/workout_geo.csv')
wk_geo.head()