Data Science | Analytics

Electric Vehicles in San Francisco


In September 2020, Governor Gavin Newsom announced a bold executive order: by 2035, all new cars and passenger trucks sold in California must be zero-emission vehicles.

San Franciscans have several reasons to consider buying an zero-emission vehicle: The Bay Area is home to electric vehicle titan Tesla, Inc., as well as up-and-coming companies like Seres, Chargepoint, and Lucid Motors. While electric vehicles are often pricier than their gasoline-fueled counterparts, California residents can receive up to $7,000 to purchase or lease an electric vehicles through the Clean Vehicle Rebate Program (CVRP).

Given the innovation in our backyard, generous financial incentives, and a 15-year deadline, I was curious to see which San Francisco neighborhood had the highest number of electric vehicles.

I gathered data from the California Open Data Portal, which provides a list of registered vehicles by ZIP code, model year, fuel type, make and duty (light/heavy).

Raw Data from the California Open Data Portal

I merged this with a data from DataSF to create a dataframe of vehicles in San Francisco neighborhoods.

Data merged by SF Neighborhoods

While my main question is which neighborhood has the highest number of electric vehicles, I was curious to know a little more about how San Franciscans get around the city.

What is the most popular car make in San Francisco?

I wasn’t surprised to see Toyota at the top of the list: I seldom go a block in San Francisco without seeing a Rav4 (perhaps not coincidentally, this is the vehicle my husband and I drive). With three luxury makes in the top ten, it seems reasonable to suggest that San Franciscans aren’t afraid to invest in their vehicle.

What is the breakdown by fuel type?

As of January 2020, only 8269 vehicles in San Francisco were powered by electric battery, compared to 358,821 gasoline-fueled vehicles.

Based on a local’s knowledge of San Francisco neighborhoods, the number of cars appears to increase as population increases: More people, more cars.

What are the most popular electric vehicles in sf?

Tesla is the clear winner with 4,622 vehicles. The company accounts for 56% of the 8269 battery-powered electric vehicles in San Francisco.

Which neighborhood has the most electric vehicles?

I’m finally ready to answer my initial question, and the winner is …

Bernal Heights/Inner Mission! My neighborhood, Noe Valley (along with the Castro) had the second most electric vehicles.

I used geopandas alongside geographic boundary data from Data SF to create a heatmap of electric vehicles by zip code.


Of the 422788 vehicles registered in San Francisco, only about 1% were battery-powered electric vehicles. Clearly, there is much work to be done to reach Governor Newsom’s 2035 target.

There are practical factors that may influence the decision to buy an electric car, for instance, one must have a reliable place to the charge the battery, so those without a garage or dedicated parking may opt out. The areas with the highest number of electric vehicles also have a large number of single family homes, while roughly speaking, Hayes Valley, Chinatown, and North Beach have more apartment buildings.

If I were to continue working on this project, I would be interested in identifying further demographic details to see positive or negative associations to electric car ownership.

About the author

Lana Palmer
By Lana Palmer
Data Science | Analytics

About me

I’m a data scientist that combines strong design and storytelling skills with rigorous analytical training to provide actionable insights about data.