Concept
While searching for a suitable dataset, I visited kaggle.com, where I found interesting statistics regarding purchases made during sales events on the Amazon marketplace. This topic captured my interest because I enjoy shopping, and discounts are always motivating to buy. To make this more illustrative, various charts would be perfect here.
I was interested in experiencing myself as a kind of marketer. To be on the other side of sales—how discounts actually influence purchasing decisions and in which categories they have the biggest impact.
Additionally, I recently became interested in the topic of sales on marketplaces: is it truly possible to make money, and what tactics should I choose? This analysis helped me better understand how discounts affect sales.
First, discounts are a primary marketing tool that influences consumer behavior. Understanding precisely how discounts impact sales can help a business optimize its offerings and pricing strategy, which in turn helps increase profits.
Second, in an environment of intense online market competition, the importance of data analysis grows daily. By researching how different product categories react to discounts, for instance, one can identify which are most sensitive to changes.
For this analysis, I used the dataset [1], which contains purchase and discount information from the Amazon marketplace.
Selected data points:
- purchase categories
- discounts
- current pricing
- discounts versus price
When stylizing the diagrams, I guided myself by the phrase: «the simpler, the clearer.» Therefore, simple, muted colors were used.
The foundation is based on Amazon colors: Orange FE9900 and black 000000.
Data and Analysis
First, I installed the necessary libraries, which allowed me to utilize their functionality for data manipulation and chart generation. After installing the libraries, I loaded the data from the «amazon.csv» file into a DataFrame using the pd.read_csv () function from the pandas library.
! pip install pandas matplotlib seaborn
import pandas as pd import matplotlib.pyplot as plt import seaborn as sns
#Load data from CSV file data = pd.read_csv («amazon.csv»)
#Transform data into the required format data['discounted_price'] = data['discounted_price'].str.replace ('₹', '').str.replace (', ', '').astype (float) data['actual_price'] = data['actual_price'].str.replace ('₹', '').str.replace (', ', '').astype (float) data['discount_percentage'] = data['discount_percentage'].str.replace ('%', '').astype (float)
#Set Seaborn style sns.set (style="whitegrid»)
The first chart is a bar chart showing the distribution across product categories. I separated the categories using the «|» symbol and then counted the number of products in each one. Finally, I selected the top ten categories and visualized them using sns.barplot ().
#1. Purchase Category Distribution plt.figure (figsize=(12, 6)) category_counts = data['category'].str.split ('|').explode ().value_counts () top_categories = category_counts.head (10) # Selecting the top 10 most popular categories sns.barplot (x=top_categories.index, y=top_categories.values, palette='viridis') plt.title ('Distribution by Category (Top 10)') plt.xlabel ('Category') plt.ylabel ('Number of Products') plt.xticks (rotation=45) plt.tight_layout () plt.show ()
The second chart—a whisker box plot—shows the distribution of discounts as a percentage. This chart type allows for a clear assessment of the spread and outliers in the discount data.
#2. Discount Whiskers Boxplot plt.figure (figsize=(12, 6)) sns.boxplot (x=data['discount_percentage'], color='lightblue') plt.title ('Boxplot: Discount Distribution') plt.xlabel ('Discount Percentage') plt.tight_layout () plt.show ()
The third plot illustrates the density distribution of current product prices, generated using the sns.kdeplot () function. This chart helps visualize how prices are distributed across goods and identifies the most common price ranges.
#3. Diagram of Current Price Distribution plt.figure (figsize=(12, 6)) sns.kdeplot (data['actual_price'], fill=True, color='skyblue', alpha=0.5) plt.title ('Density Distribution of Current Prices', fontsize=16, fontweight='bold') plt.xlabel ('Current Price', fontsize=14) plt.ylabel ('Density', fontsize=14) plt.grid (axis='y', linestyle='--', alpha=0.7) plt.tight_layout () plt.show ()
The fourth chart is a scatter plot that displays the relationship between the current price and the discount percentage. This helps visualize how the product’s price relates to its discount, which is useful for pricing analysis.
#4. Discount Percentage vs. Price plt.figure (figsize=(8, 4)) sns.scatterplot (x='actual_price', y='discount_percentage', data=data, alpha=0.6) plt.title ('Discount vs. Price', fontsize=10) plt.xlabel ('Price', fontsize=8) plt.ylabel ('Discount (%)', fontsize=8) plt.tight_layout () plt.show ()
Data Visualization
Vertical Histogram. Categories
Mustache Drawer. Discounts
Line Chart. Current Pricing
Dot plot. Discount and price
Generative Model Application Description
The cover was created using the fusionbrain.ai website. URL: https://fusionbrain.ai/editor/
List of Sources
[1] KARKAVELRAJA, «Amazon Sales Dataset», 2023. URL: https://www.kaggle.com/datasets/karkavelrajaj/amazon-sales-dataset?resource=download
Notebook and Database
https://drive.google.com/drive/folders/1FGVXw1dwzE3PrazAq9CDYOShC0QOzdzG?usp=sharing
