BW #21: Electric cars

How popular are electric cars? How much have they grown in popularity, and how popular are they in different regions of the world? This week, we'll look at some data about electric vars.

BW #21: Electric cars

It's quite amazing to see how much the electric-car market has changed: It used to be considered cutting edge to get a hybrid like the Prius, and then Tesla was pretty much the only game in town. But a large number of companies, from small startups to established manufacturers, are getting into the electric-car market.

In many ways, I feel that buying an electric car nowadays is similar to buying a computer in the mid-1980s: If you can somehow wait another six months, you'll get a better car for more money, thanks to both technological advances and the pressures of competition.

Just this week, Fareed Zakaria's "Global Public Square" show on CNN included an interview with Bill Ford, the chairman of the Ford Motor Company, describing their plans and efforts to come out with electric vehicles. (You can listen here: https://edition.cnn.com/audio/podcasts/fareed-zakaria-gps/episodes/7175ec90-bb7e-4f8d-9e19-b02501068413 )

Ford, of course, has been around for more than a century, and is as traditional as car manufacturers get. But even they realize that the tide is changing, and that all-electric vehicles are the future. As such, they even have an electric version of their popular F150 truck -- not the sort of product that you would normally think appeals to the environmentalist crowd.

And of course, Ford isn't alone; Kai Ryssdal dedicated an entire episode of Marketplace to an interview with Mary Barra, CEO of GM, which you can read/hear here: https://www.marketplace.org/2023/06/08/gm-ceo-mary-barra-electric-vehicles-charging-stations/. Kara Swisher regularly raves about her Chevrolet Bolt (from GM) on her podcasts.

And Tim Harford, on his wonderful "More or Less" podcast from the BBC, recently investigated whether electric vehicles are so much heavier than gasoline-powered cars that they'll lead to the collapse of bridges and parking garages: https://www.bbc.co.uk/sounds/play/m001mt53

I’ve thus been hearing and thinking a lot about electric cars, and thought that it might be appropriate to look into them together.

I should add that when my children were little, the notion of an all-electric car seemed like something of a fantasy, rather than an inevitability. We often listened to the They Might Be Giants song, "Electric Car," on their (terrific) album about science:

It now indeed seems inevitable that within a decade, most cars will be electric.

But hey, let’s look at the data!

Data

This week, we'll look at data about electric vehicles. There are a lot of different sources on this, but in the end, I decided that we could use some data from the IEA (International Energy Agency, https://iea.org), which has some basic data we can look through. We previously looked at some IEA data back in BW #16, about consumer oil prices (https://www.bambooweekly.com/p/bw-16-consumer-oil-prices-solution).

The data comes from this page:

https://www.iea.org/data-and-statistics/data-tools/global-ev-data-explorer

First, there is historical data about electric vehicles, at

https://api.iea.org/evs/?parameter=EV%20sales&mode=Cars&category=Historical&csv=true

We can also learn about how much oil we aren't using, thanks to the use of electric vehicles:

https://api.iea.org/evs/?parameter=Oil%20displacement%20Mbd&mode=Cars&category=Historical&csv=true

These files are in CSV format.

Note that this data separates out the two types of electric vehicles: BEV (battery electric vehicles) and PHEV (plugin-hybrid vehicles). Both can have their batteries charged, but PHEVs also have gasoline engines. Also note that the "region" column has a number of overlapping values; "world" obviously includes all countries, "Europe" and "EU27" include a subset of the world, and then we have individual countries, too. In most of these challenges, we'll just assume that we want all named regions, even if they overlap.

Questions

This week, I have seven questions for you to answer.

This week’s learning goals are: Combining data frames, complex queries, grouping, pivot tables, multi-indexes, and plotting with Seaborn.

  • Create a data frame for the historical data.
  • In 2022 (the most recent year for which we have data), if we look at numbers for the entire world, which sold more, BEVs or PHEVs? How much more?