Okay, so I was messing around with some baseball data, specifically looking at team names and stuff, and I stumbled upon this idea of “legacy titles.” You know, like how some teams have changed names or moved cities over the years. I thought it would be cool to track those changes.
First, I grabbed a dataset. I think it was from some online sports database, I honestly can’t remember exactly which one, but it had all the team names and the years they used them.

Digging into the data
Then, I started playing with it. My initial thought was simple: just list out all the names each team has ever had. Easy peasy, right?
I opened up my trusty text editor (yeah, I’m old school, no fancy tools here) and started coding.
- I basically looped through the data.
- For each team, I checked if the name was different from the previous year.
- If it was, I added it to a list of “legacy titles” for that team.
Iterating a simple output
I ran my script, and boom, I had a big ol’ list of names. It was kinda messy, just a raw dump of data, but it was a start!
The output was pretty basic at first. For example, let’s say the team name ‘Cardinals’ are still ‘Cardinals’.
It showed something like:
Cardinals: Cardinals, Cardinals, Cardinals, Cardinals, Cardinals
After a while, I realized I could make it a little cleaner. Instead of just listing all the names, I decided to group them by the years they were used. That way, you could actually see the timeline of the name changes.

So, I changed the data to the following structure:
Cardinals: 1900-present
I tweaked my code, added a few more lines to keep track of the years, and reran it. Much better! Now it was actually readable and made sense.
It wasn’t anything fancy, I’m no data scientist, but it was a fun little project to do and that is all.