Okay, so I’ve been wanting to make a map of all the MLB baseball stadiums for a while now. I’m a huge baseball fan, and I thought it would be cool to have a visual representation of where all the teams play. So, I finally decided to do it. Here’s how it went down:

Getting Started
First things first, I needed a list of all the stadiums. Obvious, right? I did a simple search, easy peasy. And boom! found lists with all the team names and their corresponding stadium names and locations.
Choosing the Tools
Next, I needed to figure out how I was actually going to make this map. I’m not a coder, so I needed something user-friendly. I am very familiar with Python, so Folium popped into my head.
The Dirty Work(Data Collection and Cleaning)
- Gathering the Data:I copy/pasted the stadium names and city into a text.
- Cleaning It Up:I used Excel, and then to save it as a CSV file. Make sure it is clean and formatted.
Coding(My Python Script)
I’ve learned some basic Python before, and this is how I made my codes work:
- Import Libraries:Folium, Pandas.
- Load Data:Read the CSV file into a Pandas DataFrame. That was easy.
- Create a Base Map:I used Folium to create a basic map of the, you know, the whole world.
- Loop and Plot:I wrote a loop that went through each row in my DataFrame. For each stadium, it pulled the latitude, longitude, and stadium name. Then, it placed a marker on the map at that location. I also set up little pop-ups, that show the stadium name when you click on the marker.
The Result
I ran the script, and… it worked! I had a map with little markers for all the MLB stadiums. I could zoom in, zoom out, and click on the markers to see the stadium names. It was exactly what I wanted!
I got to say, this project, although simple, makes me feel pretty good. It combined my love for baseball with the fun little map-making.
