BW #67: Electric cars
About a year ago, back in BW #21, we looked at electric cars. I said at the time that my family was thinking of getting one, and our analysis showed that the number of EVs has indeed been rising.
A few months ago, we did indeed get such a car (a Kia EV6, which we love). We see numerous electric cars everywhere in Israel, the majority of them from Chinese manufacturers. It's common to see electric charging stations at gas stations, shopping malls, and parking lots — as well as in many people's private garages (including ours). I've traveled to Europe several times over the last year, and we saw many electric cars there, as well.
I arrived in the United States about a week ago, and I've been rather surprised to see so few electric cars on the road. The contrast with other countries I've visited, at least in what I've seen, is quite stark.
One way to increase the number of EVs in the United States would be to import the inexpensive Chinese-manufactured vehicles that are so popular elsewhere. But many experts and governments believe that the Chinese government is subsidizing these manufacturers, allowing them to price the cars below what would be the normal rate. The Biden administration worries, not unreasonably, that a flood of cheap Chinese EVs would be disastrous for the American auto industry. As a result, they recently announced massive import taxes on EVs manufactured in China (https://www.nytimes.com/2024/05/15/business/economy/china-electric-vehicles-biden-tariffs.html?unlocked_article_code=1.t00.LpnP.Iciy7ilqMVES&smid=url-share).
I couldn't find any good data on the number of Chinese vehicles, so I decided to stick with the IEA (International Energy Association, https://iea.org) data on the share of various kinds of cars manufactured and sold in various countries. In this way, I hope that we can get a better sense of how popular EVs are, and where.
Data and six questions
This week's data comes from the IEA's latest "Global EV outlook" (https://www.iea.org/reports/global-ev-outlook-2024). The data is downloadable from their "data explorer" page:
https://www.iea.org/data-and-statistics/data-tools/global-ev-data-explorer
You can download the data, or parts of it, by going to the above URL and selecting "ev sales," "cars," and "world" on the pull-down menus. Then click on "download data," and the CSV file should be downloaded to you.
Here are my six tasks and questions for this week. They have to do with filtering, grouping, multi-indexes, pivoting, piping, and also styling Pandas data frames. As always, I'll be back tomorrow with my full solutions, including the Jupyter notebook I used in my solution:
- Read the EV data into a data frame. Remove rows from the "world" region. Keep only those rows with "EV sales" and "EV stock" parameters.
- Create a data frame showing the number of cars sold each year, in each country, with a BEV ("battery electric vehicle") powertrain.