Skip to content
2 min read · Tags: datetime joins grouping pivot-table window-functions plotting

BW 148: US Manufacturing

Get better at: Working with CSV files, date parsing, working with dates and times, joins, grouping, pivot tables, window functions, and plotting.

BW 148: US Manufacturing

Since returning to the White House earlier this year, Donald Trump has often spoken about the need for more manufacturing in the United States, and to reduce the reliance on imports. He says that this will reduce prices, increase employment, and generally strengthen the US economy. There are a number of holes in this logic, but I thought that it would be interesting to actually look at manufacturing data from the US, and see where things stand in a number of different business sectors.

It turns out that the International Trade Administration (https://www.trade.gov/), part of the Department of Commerce, tracks a number of data points having to do with manufacturing, including employment and the balance of trade. I thought that it would be interesting to look at this data, and see what we could gather about US manufacturing in general, and about manufacturing since Trump returned to office in particular.

Data and five questions

The data comes from the ITA "manufacturing industry tracker," at https://www.trade.gov/data-visualization/ita-manufacturing-industry-tracker . You can download the data by clicking on the "download data" button, which returns a CSV file.

Learning goals for this week include: Working with CSV files, date parsing, working with dates and times, joins, grouping, pivot tables, window functions, and plotting.

Paid subscribers, including members of my LernerPython.com membership program, get the data files provided to them , as well as all of the questions and answers each week, downloadable notebooks, and participation in monthly office hours.

Here are my five questions for this week. I'll be back tomorrow with solutions and full explanations: