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
import pandas as pd
import matplotlib.pyplot as plt

# Read data into pd and Preview
workout_df = pd.read_csv("data/workout.csv")
three_keywords_df = pd.read_csv("data/three_keywords.csv")
workout_geo_df = pd.read_csv("data/workout_geo.csv")
three_keywords_geo_df = pd.read_csv("data/three_keywords_geo.csv", index_col= 0)

#Preview workout_df
print(workout_df.shape)
print(workout_df.head(5))
print(workout_df.columns)

#Preview three_keywords_df
print(three_keywords_df.shape)
print(three_keywords_df.head(5))
print(three_keywords_df.columns)

#Preview workout_geo_df
print(workout_geo_df.shape)
print(workout_geo_df.head(5))
print(workout_geo_df.columns)

#Preview three_keywords_geo_df
print(three_keywords_geo_df.shape)
print(three_keywords_geo_df.head(5))
print(three_keywords_geo_df.columns)

#Global search for "workout" (Option 1)
year_str = workout_df[workout_df["workout_worldwide"] == 100]
print(year_str)
year_str = "2020"

#Plot the workout_df (Option 2)
plt.figure(figsize=(12,6))
workout_df.plot(kind= "bar", x= "month", y= "workout_worldwide", grid= True)
plt.show()

#Popular keyword during covid pandemic and currently 
plt.figure(figsize=(12,5))
three_keywords_df.plot(x="month", y="home_workout_worldwide", kind="bar", title="Home_Workout_Worldwide", grid=True)
plt.show()

plt.figure(figsize=(12,5))
three_keywords_df.plot(x="month", y="gym_workout_worldwide", kind="bar", title="Gym_Workout_Worldwide", grid=True)
plt.show()

plt.figure(figsize=(12,5))
three_keywords_df.plot(x="month", y="home_gym_worldwide", kind="bar", title="Home_Gym_Worldwide", grid=True)
plt.show()

peak_covid= "home_workout_worldwide"
current= "gym_workout_worldwide"

#Country with highest interest in workout 
print(workout_geo_df[workout_geo_df["country"]=="United States"])
print(workout_geo_df[workout_geo_df["country"]=="Australia"])
print(workout_geo_df[workout_geo_df["country"]=="Japan"])
top_country = "United States"

#Interested in expanding home workout to either Malaysia or Philippines 
print(three_keywords_geo_df.loc["Malaysia",:])
print(three_keywords_geo_df.loc["Philippines",:])
home_workout_geo = "Philippines"