The datasets this course uses
The datasets in this course are four public tables, Titanic, the Ames house prices, a mobile price table and a Mercedes-Benz test-bench table, each read straight from a raw GitHub address so that nothing has to be downloaded first.
Last updated: 12 Oct, 2026 · pandas 3.0 · scikit-learn 1.9
The process, step by step listed the steps. This lesson loads the data those steps run on, prints the shape of each table, and shows the two reads that are not a plain read_csv: an Excel file and a zip.
Reading a CSV from a raw GitHub address
pandas.read_csv accepts a URL wherever it accepts a path. GitHub serves the raw bytes of a file from raw.githubusercontent.com, so a table in a public repository can be read in one line. The address is raw.githubusercontent.com/<user>/<repo>/<branch>/<path>, and the branch is part of it.
import pandas as pd
url = ("https://raw.githubusercontent.com/krishnaik06/"
"Feature-Engineering-Live-sessions/master/titanic.csv")
df = pd.read_csv(url) # read over the network, nothing saved to diskSplitting the address across two string literals keeps the line short; Python joins adjacent string literals for you. Nothing is written to your disk, so the next run reads it again. df.to_csv("titanic.csv", index=False) keeps a local copy when you want to work offline.
Loading the four tables
import pandas as pd
GH = "https://raw.githubusercontent.com/krishnaik06/"
titanic = pd.read_csv(GH + "Feature-Engineering-Live-sessions/master/titanic.csv")
ames = pd.read_csv(GH + "Advanced-House-Price-Prediction-/master/train.csv")
mobile = pd.read_csv(GH + "Feature-Engineering-Live-sessions/master/mobile_dataset.csv")
mercedes = pd.read_csv(GH + "Feature-Engineering-Live-sessions/master/mercedes.csv",
usecols=['X1', 'X2'])
for name, frame in [("titanic", titanic), ("ames", ames),
("mobile", mobile), ("mercedes X1 X2", mercedes)]:
print(f"{name:15} {frame.shape[0]:5d} rows x {frame.shape[1]:2d} columns")titanic 891 rows x 12 columns ames 1460 rows x 81 columns mobile 2000 rows x 21 columns mercedes X1 X2 4209 rows x 2 columns
Reading the four shapes
- titanic, 891 rows and 12 columns. Passengers of the Titanic, with
Age19.87% missing andCabin77.10% missing. It carries the missing value lessons, the outlier lessons and the scaling lessons, becauseAgeandFareare two numeric columns with very different shapes. - ames, 1460 rows and 81 columns. House sales in Ames, Iowa, with a
SalePricetarget. Eighty-one columns is enough for a dtype audit, a correlation heatmap and a feature selection pass to be worth running, and it is the dataset the project part builds on. - mobile, 2000 rows and 21 columns. Mobile phone specifications with a
price_rangeclass from 0 to 3. Every column is numeric and the target is categorical, which is what the chi square and mutual information lessons need. - mercedes X1 and X2, 4209 rows and 2 columns. Two anonymised categorical columns from a Mercedes-Benz test-bench table, read with
usecolsbecause the full file has 378 columns and 3 MB. They hold enough distinct values to make one hot encoding a bad idea, which is the point of the high cardinality lesson.
Reading an Excel pair with openpyxl
Two of the derived feature lessons use a pair of flight fare spreadsheets. read_excel replaces read_csv, and it needs the openpyxl package, which the install line put in place. The folder name contains a space, and a URL cannot: %20 is how a space is written in one.
import pandas as pd
FLIGHT = ("https://raw.githubusercontent.com/krishnaik06/"
"5-Days-Live-EDA-and-Feature-Engineering/main/Flight%20Prediction/")
train = pd.read_excel(FLIGHT + "Data_Train.xlsx")
test = pd.read_excel(FLIGHT + "Test_set.xlsx")
print("train", train.shape, " test", test.shape)
print(train[['Airline', 'Date_of_Journey', 'Duration', 'Total_Stops', 'Price']].head(3).to_string())train (10683, 11) test (2671, 10)
Airline Date_of_Journey Duration Total_Stops Price
0 IndiGo 24/03/2019 2h 50m non-stop 3897
1 Air India 1/05/2019 7h 25m 2 stops 7662
2 Jet Airways 9/06/2019 19h 2 stops 13882- (10683, 11) and (2671, 10). The training sheet has the
Pricecolumn, the test sheet does not, which is the usual shape of a competition pair. Durationholds'2h 50m'andTotal_Stopsholds'non-stop'. Both are text that has to become a number, which is what the derived feature part does.- The space in the folder name is written
%20. Passing the address with a real space in it raisesInvalidURL: URL can't contain control charactersbefore anything is downloaded.
The Zomato zip
One dataset arrives as a zip holding eight files, and it cannot be read by passing the zip URL to read_csv: pandas unpacks a single member zip and refuses one with eight. The table inside it is also not UTF-8. Reading a CSV that is not UTF-8 opens it, because both problems are what that lesson is about.
What each dataset is used for
| Dataset | Shape | Used for |
|---|---|---|
titanic.csv | 891 × 12 | Missing values, outliers, scaling, transformations, duplicates |
Ames train.csv | 1460 × 81 | The dtype audit, the missing value map, correlation, selection, the project |
mobile_dataset.csv | 2000 × 21 | Chi square, mutual information, tree importances |
mercedes.csv | 4209 × 2 | One hot encoding when a column has many categories |
Flight .xlsx pair | 10683 × 11 and 2671 × 10 | Features from dates, times and durations |
Zomatodataset.zip | 9551 × 21 inside | Reading a dirty file, the first look, merging, charts |
Where you read data by URL
- A tutorial or a shared notebook. Everyone who runs it gets the same bytes, with no step that says download this file first.
- A dataset that is small and public. Up to a few megabytes, a read over the network costs about a second and saves keeping a copy in sync.
- A pinned snapshot. Putting a commit hash in the address instead of a branch name freezes the file, so a later commit to that repository cannot change your numbers.
to_csv when you are working without a connection.Related
- Previous: The process, step by step
- Next: Copy-on-write and chained assignment
- Reference: pandas.read_csv and pandas.read_excel
- Load the Ames
test.csvfrom the same repository and compare its shape withtrain.csv. Which column is missing, and why? - Drop
usecols=['X1', 'X2']from the Mercedes read and print the shape. Time both reads with%%timein a notebook cell. - Put a real space back into the flight address in place of
%20and read the error urllib raises before any download starts.
Slow is fine. Stopping is the only problem.