Member-only story

How to simulate sales data in Python

Anita Owens
6 min readDec 31, 2022

--

Stretch your data analysis skills by creating your own datasets

Photo by Girl with red hat on Unsplash

Introduction

This article will walk through how to simulate data in Python. Why simulate your own data?

Have you ever spent hours looking for the right dataset to try out a newly acquired skill or technique but you couldn’t quite find what you were looking for and just gave up?

Creating your own dataset gives you a few advantages:

1. To test your analysis to make sure it’s working as expected.
2. To make changes to your dataset to see what happens and how your
conclusions might change based on different parameters (e.g. how
sales are impacted by different levels of the price of our product).

We want to simulate weekly sales of a product at a store. It could be an
in-store or e-commerce site. We want to create a dataset with the five (5) following variables:

1. Sales date (based on week level granularity)
2. Unit sales
3. Unit price
4. Paid social ads
5. Promotion — whether there was a promotion this week.

--

--

Anita Owens
Anita Owens

Written by Anita Owens

Analytics engineer, mentor and lecturer in analytics. The glue person bridging the gap between data and the business. https://www.linkedin.com/in/anitaowens/

No responses yet