DEV Community

Burhan
Burhan

Posted on

Using Python to Analyze Seasonal Trends in Homeware Shopping

I wanted to analyze seasonal trends in homeware purchases using a simple Python script. I scraped product data from a UK decor site and plotted monthly popularity of items like mirrors and vases. Here's the code that aggregates sales data by month:

python
import pandas as pd
import matplotlib.pyplot as plt

Sample data

data = {
'month': ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
'mirrors': [12, 15, 20, 18, 22, 25],
'vases': [8, 10, 14, 16, 12, 9]
}
df = pd.DataFrame(data)

df.set_index('month').plot(kind='bar')
plt.title('Monthly Homeware Sales Trends')
plt.ylabel('Units Sold')
plt.xlabel('Month')
plt.legend()
plt.show()

This revealed that mirrors peak in summer for outdoor decor, while vases do well in spring for floral arrangements. Seasonal planning is key for any homeware collection. Have you noticed similar patterns in your shopping?

Top comments (2)

Collapse
 
kevincarroll85 profile image
kevincarroll

Interesting analysis! I've noticed a similar spike in vase sales around March at local garden centers here in the US. Do you have plans to extend this to predict trends for the rest of the year?

Collapse
 
dylan_parker123 profile image
Dylan Parker

Interesting analysis! I've noticed a similar spike in vase sales around March at local garden centers here in the US. Do you have plans to extend this to predict trends for the rest of the year?