Datasets for Python and pandas practice
14 datasetsthat fit Python ยท 2 exercises with answers
CSV and JSON files that load with one line of pandas, with real data from USGS, the Census Bureau and the World Bank. Updated 3 November 2026.
textnumberdateyes/no
Start here
Every file loads with pd.read_csv or pd.read_json. The real datasets (weather, earthquakes, population, GDP) are good for groupby, time series and plotting; the messy customer list is for cleaning.
pd.read_csv("file.csv") or pd.read_json("file.json"). JSON files are arrays of objects with real numbers, true/false and null.
Datasets for Python
| Dataset | What it is | Max rows |
|---|---|---|
| Sample sales data | Superstore-style retail orders with sales, cost, discount and profit. | 10,000 |
| Sample employee data | An HR table: departments, titles, hire dates, salaries and managers. | 10,000 |
| Sample customer data | A customer list with segments, order counts, lifetime spend and activity. | 10,000 |
| Sample SQL database | Four related tables (customers, products, orders, order items) for JOIN practice. | 1,000 |
| Messy data for cleaning practice | A customer list with duplicates, blanks, mixed dates and text in number columns. | 10,000 |
| Sample website traffic data | Daily sessions, users, bounce rate and conversions by channel. | 10,000 |
| Sample marketing campaign data | Budget, spend, impressions, clicks, CPA and ROAS per campaign. | 10,000 |
| Sample student data | Test scores, averages, letter grades and attendance for grades 9-12. | 10,000 |
| Sample restaurant sales data | Order lines with menu items, tickets, order type and payment. | 10,000 |
| Sample bank transaction data | One fictional account: debits, credits, categories and a running balance. | 10,000 |
| Earthquake data (USGS) | Every magnitude 2.5+ earthquake worldwide in a 30-day window, from USGS. | 2,013 |
| World population by country | World Bank population for 217 countries and economies, 2000-2023. | 5,208 |
| GDP by country | World Bank GDP in current U.S. dollars for 217 countries and economies, 2000-2023. | 5,208 |
| Daily weather data, 2024 | Daily temperature, rain and wind for 10 cities through 2024 (Open-Meteo). | 3,660 |