Dataset Python
Sales Transactions Dataset
A small fictional sales file for learning Python basics, validation rules and a first standard-library batch job.
- Type
- Dataset
- Level
- Beginner
- Updated
In short
Twenty fictional sales rows from three stores, with deliberate problems to find. Twelve rows are valid and eight break a validation rule.
Downloads and links
Who it is for
- Beginners following the Python lessons of the Become a Data Engineer roadmap
- Anyone who wants a tiny, predictable file to practice validation logic
What it helps you do
- Read a CSV file with Python and inspect its rows
- Apply required-field and numeric validation rules
- Check your results against known counts and totals
On this page
Dataset shape
The file sales_transactions.csv has a header row and 20 data rows. All stores, products and transactions are fictional, and the file contains no personal information.
| Column | Meaning |
|---|---|
transaction_id |
Identifier such as T1001. One row has a blank value |
order_date |
ISO date (YYYY-MM-DD) between 2026-03-02 and 2026-03-08 |
store |
Lisbon, Porto or Faro |
product |
Notebook, Desk Lamp, Backpack or Water Bottle. One row has a blank value |
quantity |
Units sold. Includes a zero, a negative number and the text two |
unit_price |
Price per unit with a dot as decimal separator. Includes a blank, a comma decimal (24,90) and a negative price |
Deliberate problems
Eight rows break one rule each, so every rule has an example to find:
| Row | Problem |
|---|---|
T1005 |
quantity is 0 |
T1007 |
product is blank |
T1008 |
quantity is -1 |
T1009 |
quantity is the text two |
T1011 |
unit_price is blank |
T1012 |
unit_price uses a decimal comma: 24,90 |
| (blank id) | transaction_id is blank |
T1018 |
unit_price is -24.90 |
Known results
Use these numbers to check your own code. With the rules “every field is present, quantity is a whole number greater than zero, unit price is a number greater than zero”:
- rows read: 20
- valid rows: 12
- rejected rows: 8
- units sold in valid rows: 43
- total revenue of valid rows (quantity × unit price): 479.70
The first eight rows alone, used in Python Essentials Part 1, contain five valid sales worth 188.70.
How the lessons use it
Set Up Python for Data Engineering asks you to save the file in a data folder and confirms Python can find it. Python Essentials Part 1 copies the first eight rows into a Python list to practice loops and conditions. Python Essentials Part 2 reads the whole file with the csv module, validates every row and writes the valid and rejected rows to separate files.
Go deeper: related articles
PythonBeginner
Set Up Python for Data Engineering
Install Python on Windows, macOS or Linux, set up VS Code, create a virtual environment, install packages with python -m pip and run your first data script.
PythonBeginner
Python Essentials for Data Engineers, Part 1
Learn Python variables, strings, numbers, lists, dictionaries, conditions and loops on real sales records, and calculate the revenue of valid transactions without pandas.
PythonBeginner
Python Essentials for Data Engineers, Part 2
Write functions and modules, read and write CSV files with the standard library, validate records, log what happens and build a small batch job you can rerun safely.
PythonBeginner
Filtering Rows in pandas
Build readable, null-safe pandas filters for realistic order questions and validate the result instead of relying on fragile expressions.