Analysis of Tesla SuperChargers Locations in the USA

Vasista Reddy
ScrapeHero
Published in
4 min readMay 10, 2023

In recent years, electric cars have become increasingly popular, and one of the most well-known electric car brands is Tesla. The company’s biggest challenge is to build a robust charging infrastructure to support its vehicles. Tesla has invested heavily in building supercharger stations in strategic locations across the United States to provide easy access for their customers to charge their electric cars.

In this analysis, we will use Python to analyze the distribution of Tesla Superchargers in the United States. We will explore the geographic distribution of the charging stations and identify states and regions with the highest concentration of superchargers.

Data Collection

We will begin by gathering data on Tesla SuperChargers Locations from ScrapeHero. The number of locations available in this dataset is 1,728. This data set was last updated on April 26, 2023. The list of fields provided by the ScrapeHero in the dataset are:

Store No., Name, Stock Ticker, Provider, Zip Code, URL, Street, Phone, Status, City, Direction URL, Stock Ticker, County, Country, Latitude, Longitude, Updated Date, State

Analysis

import pandas as pd

df = pd.read_csv(“Tesla_Superchargers_USA.csv”)

df.head(n=10)

sample dataset

Data Visualization

To visualize the data, we will use the folium library to create an interactive map of the United States. We will plot each supercharger location on the map as a marker, with the size of the marker representing the number of charging stalls at each location.

Map of Tesla Supercharger locations in the USA
Zoomed in map of Tesla Supercharger locations in the USA

Top 10 US States with the most number of supercharger stations

import matplotlib.pyplot as plt

state_counts = df[‘State’].value_counts()[:10]
plt.bar(state_counts.index, state_counts.values)
plt.show()

With every state having at least 1 station, California is at the top with 305 stations.

Bar Chart-State vs Count

Representing the state-wise count of stations on Choropleth maps

url = (
https://raw.githubusercontent.com/python-visualization/folium/main/examples/data"
)
state_geo = f”{url}/us-states.json”

# Create a Folium map centered on the USA
usa_map = folium.Map(location=[39.8283, -98.5795], zoom_start=4)

# Group the data by state and count the number of stores in each state
store_counts = df.groupby(‘State’)[‘Store No.’].count().reset_index()

# Add a choropleth layer to the map to show the store counts by state
folium.Choropleth(
geo_data=state_geo,
name=’choropleth’,
data=store_counts,
columns=[‘State’, ‘Store No.’],
key_on=’feature.id’,
fill_color=’BuPu’,
fill_opacity=0.7,
line_opacity=0.5,
legend_name=’Number of Stores’
).add_to(usa_map)

# Display the map
usa_map

Choropleth Map of Tesla Supercharger locations in the USA

Scenario: Finding the number of supercharger stations about 100 miles from Yellowstone National Park

# Importing the geodesic module from the geopy library
from geopy.distance import geodesic

# the lat-long data for Yellow_Stone_National_Park
Yellow_Stone_National_Park = (44.49780341658212, -110.50204978002547)

def findDistance(lat, lon):
# Print the distance calculated in km
return geodesic(Yellow_Stone_National_Park, (lat, lon)).miles

df[“distance_from_park”] = df.apply(lambda x:findDistance(x.Latitude, x.Longitude), axis=1)

df.sort_values([“distance_from_park”])[:10][[“Store No.”, “Name”, “distance_from_park”]]

Preview

These 7 stores are around 100 miles from the Yellowstone National Park. West Yellowstone Supercharger is the closest one with 31 miles from the park.

Plotting the stations around the Park using Folium

df_test = df.sort_values([“Yellow_distance”])[:7][[“Store No.”, “Name”, “distance_from_park”, “Latitude”, “Longitude”]]

# Create a Folium map centered on the USA
usa_map = folium.Map(location=[39.8283, -98.5795], zoom_start=4)

# Add markers for each store location
for index, row in df_test.iterrows():
folium.Marker([row[‘Latitude’], row[‘Longitude’]], popup=row[‘Name’], icon=folium.Icon(icon=”minus”, color=”blue”)).add_to(usa_map)

# Display the map
usa_map

Stations around the Park

The data for the analysis is available at ScrapeHero.

Conclusion

In this blog analysis, we found that the charging stations are distributed across the country, with the highest concentration in California, Texas, and Florida.

Tesla has invested heavily in building a robust charging infrastructure to support their electric vehicles. With the continued growth of the electric vehicle market, it will be interesting to see how Tesla continues to expand its supercharger network in the future. Thanks for reading!!!

If you’ve found this article helpful or intriguing, don’t hesitate to give it a clap! As a writer, your feedback helps me understand what resonates with my readers.

Follow ScrapeHero for more insightful content like this. Whether you’re a developer, an entrepreneur, or someone interested in web scraping, machine learning, AI, etc., ScrapeHero has compelling articles that will fascinate you.

--

--

Vasista Reddy
ScrapeHero

Works at Cognizant. Ex-Turbolab-ian and loves trekking…. Reach_Me_Out_on_Linkedin: https://www.linkedin.com/in/vasista-reddy-100a852b/