Pizza Sales Analysis using Python: Uncovering Insights and Recommendations

Tri Handayani
7 min readMay 25, 2023

--

Photo by Ivan Torres on Unsplash

Introduction

Embark on a captivating Python-powered data analysis journey as we explore a comprehensive dataset obtained from a bootcamp. By delving into the realm of pizza sales, we aim to extract crucial insights that can revolutionize decision-making for pizza businesses. Through meticulous data cleaning, preparation, and visualization, we uncover key details such as the highest sales month, peak hours, popular pizza types, revenue contributions by size, and top revenue-generating pizza types. Armed with these insights, we offer actionable recommendations to optimize operations and maximize revenue potential. Get ready to dive into the world of pizza sales and unlock the secrets that lie within the data. Let’s begin the adventure!

Objective

The objective of this analysis is to gain insights into pizza ordering patterns and revenue contributions based on different factors such as pizza type, size, and time of day. By exploring the data and visualizing key metrics, we aim to identify the month with the highest sales, peak ordering hours, the most popular pizza types, the pizza size contributing the most to revenue, and the revenue generated by each pizza type. This analysis will provide valuable information for understanding customer preferences, optimizing inventory, and making data-driven decisions for business growth.

Data Source

The data used for this analysis is sourced from a bootcamp dataset and represents pizza order information from the year 2015. The dataset provides detailed information on orders, order details, and pizza types. It offers a comprehensive view of customer preferences, order quantities, prices, and other relevant attributes. By utilizing this dataset, we can uncover valuable insights about pizza ordering trends and revenue contributions during the specified time period.

Data Cleaning and Preparation

Before proceeding with the analysis, the dataset was subjected to data cleaning and preparation steps. Firstly, we checked for missing values in the dataset to ensure data integrity. Fortunately, no missing values were found, indicating a complete and reliable dataset. Secondly, we examined the dataset for any duplicate entries and removed them to eliminate redundancy and maintain data accuracy. These initial data-cleaning steps ensured that the dataset was ready for exploration and analysis, providing a solid foundation for deriving meaningful insights.

Data Exploration and Visualization

Finding the Month with the Highest Sales

To identify the month with the highest sales, we conducted data exploration using a line chart. The sales data was aggregated and plotted against the corresponding months. The line chart revealed the trend of sales over the months, allowing us to determine the month with the highest sales. The screenshot below showcases the line chart highlighting the sales trend.

Determining Peak Hours of Order Placement

Another aspect of data exploration was to identify the peak hours when customers placed their orders. By analyzing the order timestamps, we extracted the hour component and aggregated the order counts for each hour. A bar chart was created to visualize the distribution of order counts across different hours of the day. The screenshot below displays the bar chart representing the peak hours of order placement.

Analyzing Highest Orders by Pizza Type

To gain insights into customer preferences, we explored the data to identify the pizza types that received the highest number of orders. The pizza types were grouped, and the order counts for each type were calculated. A bar chart was generated to visualize the order counts for different pizza types. The screenshot below depicts the bar chart showcasing the highest orders by pizza type.

Exploring Revenue Contribution by Pizza Size

We further examined the revenue contribution by pizza size to understand the profitability of different sizes. The revenue was calculated by multiplying the quantity ordered by the price for each pizza size. The revenue contributions for different sizes were calculated, and a pie chart was generated to visualize the distribution of revenue among pizza sizes. The screenshot below demonstrates the pie chart illustrating the revenue contribution by pizza size.

Determining Revenue for Each Pizza Type

Lastly, we explored the revenue generated by each pizza type to identify the most lucrative pizza types. The revenue was calculated by multiplying the quantity ordered by the price for each pizza type. The revenue contributions for different pizza types were calculated, and a bar chart was created to visualize the revenue for each type. The screenshot below showcases the bar chart displaying the revenue for each pizza type.

Insights

  1. The month with the Highest Sales: Based on the data analysis, it was found that the month with the highest sales was July 2015. This indicates a peak period of customer demand during that time.
  2. Peak Hours: The analysis revealed that the peak hours for pizza orders were between 12–1 pm and 5–6 pm. This suggests that customers tend to place orders during lunchtime and early evening, which can be valuable information for resource allocation and staffing.
  3. Highest Orders by Pizza Type: The pizza type “Classic Deluxe” emerged as the most popular choice among customers, with the highest number of orders. This indicates a preference for this particular pizza variant among the target audience.
  4. Revenue Contribution per Pizza Size: Among the different pizza sizes, size L (Large) had the highest revenue contribution. This suggests that customers often opt for larger pizza sizes, which can be leveraged for targeted marketing and promotional strategies.
  5. Revenue for Each Pizza Type: The analysis further revealed that the “Thai Chicken” pizza type generated the highest revenue compared to other pizza types. This indicates a strong demand for this particular pizza variant and presents an opportunity to capitalize on its popularity.

Recommendations

Based on the insights gained from the data analysis, the following recommendations can be made:

  1. Promote Special Deals During July: Since July was identified as the month with the highest sales, it presents an opportunity to run special promotions and offers to capitalize on the increased customer demand. Consider creating exclusive deals or limited-time offers to attract more customers and boost sales during this peak period.
  2. Staff and Resource Allocation during Peak Hours: With the peak hours for pizza orders identified as 12–1 pm and 5–6 pm, it is recommended to allocate additional staff and resources during these time frames. Ensuring sufficient manpower and faster order processing during these peak hours will help provide better customer service and improve overall customer satisfaction.
  3. Feature and Upsell the Classic Deluxe Pizza: Given that the “Classic Deluxe” pizza type had the highest number of orders, it is recommended to highlight and promote this particular pizza variant. Consider showcasing its unique features and offering special deals or combo options that include the Classic Deluxe pizza to encourage customers to choose it more frequently.
  4. Emphasize Large Pizza Size Options: Since size L (Large) pizzas contributed the most to revenue, it is advisable to focus on promoting and upselling larger pizza sizes. Highlight the value for money, family-friendly portions, and customizable toppings for large pizzas in marketing campaigns and menu displays to encourage customers to opt for larger sizes.
  5. Maximize the Thai Chicken Pizza’s Potential: As the pizza type with the highest revenue, it is important to leverage the popularity of the “Thai Chicken” pizza. Consider featuring it prominently on the menu, creating special promotions or limited-time offers around this pizza variant, and highlighting its unique flavors or ingredients to attract more customers and drive sales.

By implementing these recommendations, the business can enhance its marketing strategies, optimize resource allocation, and focus on customer preferences to maximize sales and revenue potential. Regular monitoring of sales data and customer feedback will also provide valuable insights for further refinement and improvement of the business’s offerings.

Visit my portfolio: https://dataexplorewithyani.my.canva.site/

BI portfolio: https://www.novypro.com/profile_projects/trihandayani

LinkedIn profile: http://www.linkedin.com/in/tri-handayani007

--

--

Tri Handayani

Passionate data analyst with expertise in PostgreSQL, Power BI, and Python. Enthusiastic about leveraging analytics to drive informed decision-making.