
Data Analysis with Python β How I Analyzed My Empire State Building Run-Up Performance
Data Analysis with Python β How I Analyzed My Empire State Building Run-Up Performance κ΄λ ¨
A tower running race is a race that you run up the stairs of a building. These happen around the world. I got the chance to participate in the Empire State Run Up in NYC, 2023 edition.
The Empire State Building Run-Up (ESBRU)βthe worldβs first and most famous tower raceβchallenges runners from near and far to race up its famed 86 flightsβ1,576 stairs.
While visitors can reach the buildingβs Observatory via elevator in under one minute, the fastest runners have covered the 86 floors by foot in about 10 minutes.
Leaders in the sport of professional tower-running converge at the Empire State Building in what some consider the ultimate test of endurance.
I got lucky and managed to participate in this race. A few days after finishing the race, I realized that I wanted to know more about my performance, and what I could have done to better.
So naturally I went to the race organizer website and started looking at the numbers. And it was slow and tedious, plus it brought up more issues:
- Getting the data for offline analysis is difficult. You can see your results and others for comparison, but I found that the tools didn't offer an option to download the raw data, and they were clumsy to use.
- Most tools out there to analyze race results are paid or do not apply to this type of race. Knowing what to expect reduces your anxiety, allows you to train better, and keeps your expectations in check.
By now you've probably guessed that you can solve the data retrieval issues and post-race analysis using low-cost Open Source tools. This also allows you to apply different techniques to learn about the race and, depending on the quality of the data, even make performance predictions.
This is a very personal piece for me. I will share my race results and give you my biased opinion about the race. π
How I Ended Up Running to the Top of the Empire State Building
Many of us have run a regular race at some point in our lives β there are many distances like 5K, 10K, Half Marathon, and Full Marathon. But there is no way to compare how you will perform while running the stairs all the way to the top of one of the most famous buildings in the world.
If you have ever been at the base of the skyscrapers in New York City and have looked up, you get the idea. Picture yourself running up the stairs, all the way to the top, without stopping.
Getting accepted is tough, because unlike a race like the New York Marathon, the Empire State Building can only accommodate around 500 runners (or should I say climbers?).
Add to that fact that the demand to participate is high, and then you can see that your chances to get in through the lottery are pretty slim (I read somewhere that there are only 50 lottery positions for more than 5,000 applicants).
You can imagine my surprise when I got an email saying that I was selected to participate after trying for 4 years in a row.
I panicked. Have you ever been at the base of the Empire State and looked up? Some days when it's cloudy you can't even see the top of the building.
I wasn't unprepared. But I had to adjust my training routine to be ready for this challenge with a small window of two months, and no experience doing a tower run.
The day of the race came and this is how it went for me:
- It was tough. I knew I had to pace myself, otherwise, the race would have ended for me on floor 20th as opposed to the 86th. You have to focus on a "keep going" mentality, regardless of how tired you feel. And then it is over, just like that.
- You don't sprint, you climb 2 steps at a time at a steady pace, and you use the handrails to take weight off your legs.
- No need to carb load or hydrate too much. If you do well, you will be done in around 30 minutes.
- Nobody is pushing anyone. At least for non-elite racers like me, I was alone for most of the race.
- I got passed and I passed a lot of people who forgot the 'pace yourself' rule. If you sprint, you will be toasted before floor 25, for sure.
I had a blast and got great satisfaction from having this race ticked off my bucket list, the same way I felt after running the NYC Marathon.
It was time now to do a post-race analysis using several of my favorite Open Source tools, which I'll explain in the next section.
What You Need to Follow this Tutorial
Like the race, most of the challenges to writing this application were mental. You only need to break the main problem down into smaller pieces and then tackle each piece at a time:
- Get the data by scraping the website (very few sites allow you to export race results as a CSV).
- Clean up the data, normalize it, and make it ready for automatic processing.
- Ask questions. Then translate those questions into code and tests, ideally using statistics to get reliable answers.
- Present the results. A UI (Text or Graphic) will do wonders due to its low consumption, but charts speak volumes too.
You should have some experience in a programming language to get the most out of this article. My code is written in Python (you will need version 3.8+) and runs on Linux (I used Fedora 37 distribution).
In a nutshell, I want to show that it is possible to do all the above with Open Source technologies. Then you can reuse this knowledge for other projects, not just for tower race analyses. π
I strongly recommend that you get the source code (josevnz/tutorials
) (It is Open Source (josevnz/tutorials
)!). Get your hands dirty, break the scripts, and have fun. You will need Git to clone the repository:
git clone https://github.com/josevnz/tutorials.git
cd tutorials/docs/EmpireStateRunUp/
python -m ~/virtualenv/EmpireStateRunUp
. ~/virtualenv/EmpireStateRunUp/bin/activate
pip install --upgrade pip
pip install --upgrade build
pip install --upgrade wheel
pip install --editable .
Or if you just want to run the code while reading this tutorial (using my latest version from Pypi):
python -m ~/virtualenv/EmpireStateRunUp
. ~/virtualenv/EmpireStateRunUp/bin/activate
pip install --upgrade EmpireStateRunUp
We can now move to the next stage:a getting the data.
What Else Can We Learn?
Participating in this race was a great experience. The best part was that it fueled my curiosity and led me to write this code to get more interesting facts about the race.
There is plenty more to learn about the tools you just saw in this tutorial:
- There are a lot of public race datasets, and you can use them to apply what you learned here. Just take a look at this dataset of the New York City Marathon, period 1970-2018 (
davidjaimes/nyc-marathon
). What other questions (meiguan/nyc2018marathonfinishers
) you can ask about the data? - You saw just the tip of what you can do with Textual. I encourage you to explore the
apps.py
(josevnz/tutorials
) module. Take a look at the example applications (Textualize/textual
) as well. - Selenium Web driver is not just a tool for web scraping but for automated testing of web applications. It doesn't get better than having your browser perform automated testing for you. It is a big framework, so be prepared to spend time reading and running your tests. I strongly suggest you look at the examples (
SeleniumHQ/seleniumhq.github.io
). Trial an error will give you better results. - Apply for the Empire Estate Run Up lottery or run through a charity, if you like this kind of race. Who said King Kong is the only one who could make it to the top?
- Sadly, I'm not in a position to offer you any training advice. Every person is different. I do recommend that you check with your doctor before you participate in a race like this, and get some professional advice from a running coach.
- But most important of all, believe you can do this (the race and writing some tools to process the race data) and have fun while doing it. This is a pre-requisite for any project.