Skip to content
4 min read · Tags: interpolation multiple-files api plotly plotting marimo

BW 145: Economic indicators

Get better at: Working with multiple files, APIs, interpolation, plotting with Plotly, and Marimo notebooks

BW 145: Economic indicators

Want to improve your Python, Git, and Pandas skills in a small group that I personally mentor — with a clear syllabus and tons of practice? Cohort 8 of my Python Data Analysis Bootcamp (PythonDAB) will start on December 4th. Watch the recorded info session at https://www.youtube.com/watch?v=pTDP9rSv75Y, or sign up for an interview at https://savvycal.com/reuven/pythondab . Full bootcamp info is at https://PythonDAB.com .

How is the US economy doing? That's an easy question to ask, and a hard one to answer briefly, mostly because there are so many variables to take into account.

On the one hand, you could say that it's going pretty well, with the stock market up overall, and unemployment relatively low. But you could also say that it's going pretty poorly, with (slowly) growing unemployment, inflation ticking up, and people remaining in their jobs for fear of having trouble finding another one. The Trump Administration's chaotic approach to international trade and tariffs, along with their large-scale deportations, have introduced large levels of uncertainty.

(This sort of answer is the reason why it's said President Truman wanted to meet a one-handed economist.)

There are numerous ways to measure the health of an economy. Among them are:

These measures are obviously connected to one another. Higher inflation will likely lead to worse consumer sentiment, and also to higher interest rates from the Federal Reserve, which will in turn lead to lower stock prices and higher unemployment. But with hundreds of millions of people and billions of transactions among consumers and businesses, you won't find a perfect correlation between any of these.

But that doesn't mean we cannot and should not try. This week, we'll thus use Marimo and Plotly to create a data dashboard that shows us the eight indicators I listed above. We'll see each indicator on its own, but also in a scatterplot to try to find correlations among them.

Oh, and why include Bitcoin in this mix? I'm a Bitcoin skeptic, and don't believe it really indicates much... but a lot of people own Bitcoin, and it's theoretically unconnected to other market measures. We'll see if that's true.

Data and five questions

This week's data all comes from Fred, the amazing data portal from the St. Louis Federal Reserve Bank, at https://fred.stlouisfed.org/ . Each data source on Fred has a unique name. You'll use the fredapi Python package to retrieve eight data sources, and then present them in a variety of ways. Note that to use the fredapi package, you will need a Fred API key, which you can get for free from https://fred.stlouisfed.org/docs/api/api_key.html .

Because the data will all come from Fred, and will be retrieved via the fredapi package, there aren't any data files to download this week.

Learning goals this week include working with APIs, handling multiple data inputs, interpolation,

Paid subscribers – including members of my LernerPython+data membership program at https://LernerPython.com – get access to all questions and answers, downloadable notebooks, and a one-click access to my notebook at Marimo's Molab. You also get invited to monthly office hours, like the ones we had earlier this week.

Here are this week's five questions and tasks; I'll be back tomorrow with my solutions and explanations: