CoolFace
Datasetpublic

yadavsaurabh/indian-railways-runs

Indian Railways: stop-level running and delay history One row is one train, at one station, on one day. What time it was due, what time it actually turned up, and how late that was. One CSV per train, named by its five digit train number. 12624.csv holds every recorded run of train 12624, oldest first. Every file has the same 24 columns. The files are split across two folders, because the Hub allows at most 10,000 files per folder. The split is by the train number's first digit:… See the full description on the dataset page: https://huggingface.co/datasets/yadavsaurabh/indian-railways-runs.

sourceHugging Facegpl-3.0updated 1d agoView on Hugging Face
1likes132downloads
Dataset Card

Indian Railways: stop-level running and delay history

One row is one train, at one station, on one day. What time it was due, what time it actually turned up, and how late that was.

One CSV per train, named by its five digit train number. 12624.csv holds every recorded run of train 12624, oldest first. Every file has the same 24 columns.

The files are split across two folders, because the Hub allows at most 10,000 files per folder. The split is by the train number's first digit:

FolderTrain numbersFiles
trains/0xxxx to 4xxxx6,738
trains_1/5xxxx to 9xxxx6,197

load_dataset("yadavsaurabh/indian-railways-runs") reads both as one table. To load one half, name it: load_dataset("yadavsaurabh/indian-railways-runs", "trains_1").

python
import pandas as pd

one = pd.read_csv("trains/12624.csv", dtype={"train_no": str}, parse_dates=["date"])
obs = one[one.reported == 1]          # the rows that were actually observed

A journey is (train_no, date). date is the day the train left its origin and stays fixed across the whole run; the per-stop *_date columns are what move past midnight.

Read this before computing anything

reported is 1 when a stop filed a live status update and 0 when it never did. A blank act_arrival is not an on-time arrival, it is an absence of evidence. About 3 stops in 23 never report, and it is systematically the same quiet stations, so filter on reported == 1 first.

Delays are never negative. The source reports 0 for on time and 0 for early. Punctuality figures from this data are a lower bound, not a symmetric measure.

March 2020 to late 2021 is empty for most trains, around 650 consecutive days, because passenger services stopped. A few specials ran and they are here. That gap is real history, not missing data.

Columns

ColumnWhat it is
dateJourney start date at the origin, YYYY-MM-DD. Constant within a run.
train_noFive digit train number, same as the filename. Keep it a string.
train_nameService name, repeated on every row.
train_typeService class, e.g. MAIL/EXPRESS, SUPERFAST.
seqPosition in the full route. Not contiguous, and blank on some rows.
station_codeIndian Railways station code.
halts_here1 for a scheduled halt, 0 for a pass-through.
sch_arrival / sch_departureScheduled times, HH:MM.
sch_arrival_date / sch_departure_dateTheir calendar dates, DD Mon YYYY.
act_arrival / act_departureObserved times. Blank where unreported.
act_arrival_date / act_departure_dateTheir calendar dates.
delay_arrival_min / delay_departure_minMinutes late, one decimal. Never negative.
platformPlatform used. A string: 2A exists, and some stations report in Devanagari numerals (१, २). Often blank.
distance_kmCumulative distance from the origin.
lat / lngStation coordinates, six decimals.
departed1 if the train had left this stop at the last observation.
reported1 if this stop ever filed an update.
reported_atWhen it did, ISO 8601 with a +05:30 offset.

Where it came from

Harvested from the public live_status cache behind whereismytrain.in, one request per train per day, flattened to one row per scheduled stop. Nothing is imputed or smoothed; blank means the source returned nothing.

This is an independent third-party collection. It is not affiliated with or endorsed by whereismytrain.in or Indian Railways.

yadavsaurabh/indian-railways-runs · CoolFace