Which Yamanote Line carriage is the most comfortable?
Playing with the Yamanote line congestion dataset

The JR East app, out since last year, has a feature called Yamanote Train Net. It shows you the current position, crowding level and cabin temperature of every carriage on the Yamanote Line — handy for finding one you can sit down in.

Carriage positions and crowding, pulled from Yamanote Train Net
Train operating data published at this granularity is rare anywhere in the world, so I crawled it and played with it, with no particular goal in mind.
Crawling the data
First, crawl the carriage positions and crowding from Yamanote Train Net.

Yamanote Train Net, in the JR East app. It shows the crowding and cabin temperature of the carriage you are in. Remarkable!
Yamanote Train Net has no browser page at all; it is an iPhone/Android screen only. So it is not quite the usual "watch the AJAX traffic in Firebug and reverse the API" job, but with a tool like this the traffic reads perfectly well. I worked out the API from that and built a crawler to fetch carriage data at a fixed interval.
First, just visualise it
To start with I animated one day of train movements and crowding. Each moving rectangle is a train; the colours inside it are the crowding of each carriage (blue: empty, red: cannot move).
Things to watch for: · the morning rush building from around 8 · trains stopping around 12 — apparently a temporary suspension caused by an obstruction on the Shōnan-Shinjuku line · the evening rush from around 18 — noticeably milder than the morning · after 23: the service gradually thins out Not hugely informative, but the wriggling is rather endearing.
Now look at the crowding patterns
Let's do some analysis that might actually be useful to somebody.
Since we have crowding data, I looked at how it varies by time of day and by carriage.
Here is crowding by station and time of day for Friday 2 April:

Yamanote Line crowding by station, 2 April 2015
· The morning rush runs from just before 7 to a little after 8. Travel outside that window and crowding may barely affect you.
· The inner loop shows almost no evening rush.
· Even on the outer loop, if you can miss roughly 17:00–18:30 it may not get too bad.
So — and I rarely take the Yamanote, so I cannot vouch for this from experience — avoid the morning rush and the line does not treat you too badly.
So which carriage should you sit in during the morning rush?
If you cannot avoid the morning rush, you would at least like to sit in an emptier carriage.
Yamanote Train Net reports crowding per carriage, so let us compute the optimal place to board.
Here is the mean crowding per carriage on departure from each station, 8–9am:

Mean crowding per carriage on departure from each station, 8–9am, 2015/3/29–2015/4/2
Broadly: on the outer loop the front carriage (car 1) is emptier, and on the inner loop the rear carriage (car 1) is.
Presumably something to do with where the stairs are at the busy stations like Tokyo.
The one exception is the outer loop around Shin-Ōkubo, where the middle looks emptier.
From this data I built a lookup table: "travelling from here to here, which carriage should I board?"

Optimal carriage by station pair, weekdays 8–9am. Numbers are car numbers, colours are mean crowding. Direction (inner/outer) is whichever is the shorter route.
In almost every case car 1 gets you through the morning rush without feeling much of it. Shinjuku → Shin-Ōkubo is crowded whatever you do; better to shift your time. Note that this optimises for mean crowding — a different criterion, such as "minimise the time spent above 60% crowding", might well give a different answer.
Afterword
· Take car 1 on the Yamanote in the morning. · I would love the Chūō line data too.
· Huge respect to JR for not obfuscating their API. (Publishing this data could annoy any number of people; I hope it doesn't.)
Update: the train movements during the nine-and-a-half-hour Yamanote outage on 12 April are quite something!
Online
- GIGAZINE2015年4月6日のヘッドラインニュース

