Before we begin, two administrative notes:
- Pandas office hours: I'll be holding office hours this coming Sunday. It's open to all paid BW subscribers, including members of my LernerPython+data platform. I'll send Zoom info in the coming day or so. Come with any and all Pandas questions!
- Agentic coding workshops: I'm offering two new hands-on agentic coding workshops later this month:
- On Thursday, April 23rd, you'll learn about OpenCode, the open-source tool that works with a variety of models, free and commercial, and
- On Monday, April 27th, you'll learn advanced techniques in Claude Code – MCP servers, skills, and multiple agents.
You can learn more about these workshops at https://lernerpython.com/code-with-claude/, or at a free info session I'm holding on Tuesday, April 21st, at https://us02web.zoom.us/webinar/register/WN_wXq9Sn1uRrOfzPzMRcSL6w.
It's April 15th. If you're like most people in the world, then it's just another day. But if you're a US citizen, then this is one of the most famous (infamous) days of the year — the deadline for filing your income taxes.
The fact that Americans have to file tax forms each year often comes as a surprise to people from other countries, where income tax is automatically deducted from your paycheck. And if you really need to file taxes, you can normally do so electronically, via a free-of-charge, government-run Web site. In Israel, where I live, only wealthy people and business owners need to file taxes – and an accountant must do so on your behalf, which is just fine with me.
If you're interested in how countries around the world handle taxation, I can recommend TR Reid's book, "A Fine Mess: A Global Quest for a Simpler, Fairer, and More Efficient Tax System," which I read a number of years ago. (I promise, it's actually quite interesting!)
Perhaps because they have to pay such close attention to taxes, Americans believe that they're paying too much. A Gallup poll released just a few days ago shows that about 60 percent of Americans feel that their taxes are too high (https://news.gallup.com/poll/707951/americans-tax-views-remain-negative.aspx ).
This week, we'll look at income taxes, in the US and across the world. Do Americans pay more than people in other countries? What sorts of trends do we see in income-tax rates over time, in the US and elsewhere?
But wait, we're also going to do something else: I've been using Marimo notebooks for some time now, and I've also been getting into agentic coding, using Claude Code and OpenCode on a regular basis. This week, the Marimo team made it possible for you to control and interact with Marimo notebooks from within Claude Code, with a skill they call "marimo-pair". This gives Claude Code access to your Marimo notebook – able to read data from it and write code and queries within it. This week, we'll use "marimo-pair" to ask our questions and get results in a Marimo notebook.
Paid subscribers, both to Bamboo Weekly and to my LernerPython+data membership program (https://LernerPython.com) get all of the questions and answers, as well as downloadable data files, downloadable versions of my notebooks, one-click access to my notebooks, and invitations to monthly office hours.
Learning goals for this week include agentic coding, working with CSV files, plotting with Plotly, grouping, and pivot tables.
Data and six questions
This week's data comes from the OECD (Organization for Economic Cooperation and Development), what the Economist often describes as "a club of mostly rich nations." We'll use the OECD's global revenue statistics database (https://www.oecd.org/en/data/datasets/global-revenue-statistics-database.html) to better understand taxation policies, and where people are paying the most, and the least, in taxes.
To get the data, I went to the global revenue page, clicked on "access the data," then clicked on "download." I then chose, from the list on the left-hand side:
- Under "time period," I chose from 1990-2024
- Under "reference area," I selected all
- Under "institutional sector," I selected "central government" and all of the areas beneath it
- Under "revenue category," I selected "total tax revenue" and all of the areas beneath it
- Under "unit of measure," I selected both "US dollar" and "percentage of GDP"
I applied these changes, clicked on "download," and selected the unfiltered CSV file. It took several minutes for the 1.1GB CSV file to be downloaded to my computer, which I then compressed into a 25 MB (yes, 98% compression!) zipped CSV file.
Here are my six questions for this week. I'll be back tomorrow with solutions and explanations:
- Load the CSV file into a data frame. You only need some of the provided columns:
Reference area,Institutional sector,Revenue category,Unit of measure,TIME_PERIOD,OBS_VALUE,Unit multiplier, andCurrency. - Do Americans, according to the data in df, pay more, less, or about the same in income taxes as people in other countries? Show your query, as well the result and your summary, in a new cell.