📊 Dataset · CSV
housing.csv dataset
Download housing.csv free (20,640 rows × 10 columns, 1.4 MB). Preview the rows and columns, load it in pandas in one line and practise with 3 Python lessons.
- Size1.4 MB
- Rows20,640
- Columns10
- Used in3 lessons
Preview (first rows)
| longitude | latitude | housing_median_age | total_rooms | total_bedrooms | population | households | median_income | median_house_value | ocean_proximity |
|---|---|---|---|---|---|---|---|---|---|
| -122.23 | 37.88 | 41.0 | 880.0 | 129.0 | 322.0 | 126.0 | 8.3252 | 452600.0 | NEAR BAY |
| -122.22 | 37.86 | 21.0 | 7099.0 | 1106.0 | 2401.0 | 1138.0 | 8.3014 | 358500.0 | NEAR BAY |
| -122.24 | 37.85 | 52.0 | 1467.0 | 190.0 | 496.0 | 177.0 | 7.2574 | 352100.0 | NEAR BAY |
| -122.25 | 37.85 | 52.0 | 1274.0 | 235.0 | 558.0 | 219.0 | 5.6431 | 341300.0 | NEAR BAY |
| -122.25 | 37.85 | 52.0 | 1627.0 | 280.0 | 565.0 | 259.0 | 3.8462 | 342200.0 | NEAR BAY |
| -122.25 | 37.85 | 52.0 | 919.0 | 213.0 | 413.0 | 193.0 | 4.0368 | 269700.0 | NEAR BAY |
| -122.25 | 37.84 | 52.0 | 2535.0 | 489.0 | 1094.0 | 514.0 | 3.6591 | 299200.0 | NEAR BAY |
| -122.25 | 37.84 | 52.0 | 3104.0 | 687.0 | 1157.0 | 647.0 | 3.12 | 241400.0 | NEAR BAY |
Columns
| Column | Type | Missing | Example |
|---|---|---|---|
longitude | decimal | 0 | -122.23 |
latitude | decimal | 0 | 37.88 |
housing_median_age | decimal | 0 | 41.0 |
total_rooms | decimal | 0 | 880.0 |
total_bedrooms | decimal | 207 | 129.0 |
population | decimal | 0 | 322.0 |
households | decimal | 0 | 126.0 |
median_income | decimal | 0 | 8.3252 |
median_house_value | decimal | 0 | 452600.0 |
ocean_proximity | text | 0 | NEAR BAY |
Load it in Python
import pandas as pd
df = pd.read_csv("housing.csv")
df.head()


