Skip to content
5 min read · Tags: api json strings regular-expressions grouping

BW #120: Pennies

Get better at: API usage, JSON manipulation, strings, regular expressions, and grouping

BW #120: Pennies

[Administrative note: Pandas office hours will take place at 17:00 tomorrow, Israel time, aka 10 a.m. Eastern. It's open to all paid subscribers, including members of my LernerPython+data membership program. Come and ask any Pandas questions you have! Full Zoom info is at the bottom of this message.]

Is the US going to abolish the penny? People have been asking that question as long as I can remember; even when I was growing up in the US, we wondered why the 1-cent coin was still around, other than nostalgia. After all, you couldn't buy anything with a penny, so it seemed rather unnecessary. A number of other countries have done away with their equivalent of the penny, including Canada, as of 2012 (https://en.wikipedia.org/wiki/Penny_(Canadian_coin)).

Of course, doing away with the coin doesn't mean that prices will have to change. When Israel removed the similar 1-agora coin from circulation, it meant that cash purchases were rounded to the nearest 5 agora mark. Electronic purchases and bank transfers remained unchanged, however.

The most recent annual report from the US Mint (https://www.usmint.gov/content/dam/usmint/reports/2024-annual-report.pdf) indicated that 80 percent of purchases are currently digital, meaning that even in the worst-case scenario, 20 percent of transactions might have to worry about pennies. That same report indicated that as of last year, each penny cost 3.69 cents to create, meaning that its face value was less than one third a penny's raw cost. Plus, they found that cash was only used in 20 percent of purchases, making it even less important to have physical pennies.

It's thus not surprising that US Treasury announced earlier this year that it will soon stop minting pennies (https://www.nytimes.com/2025/05/22/us/politics/penny-manufacturing.html?unlocked_article_code=1.Kk8.pHPc.l144zQJcZEc_&smid=url-share). You'll still be able to use them to pay for things -- presumably only at stores that have annoyed you, and against whom you want to take revenge -- but no new ones will be created. And both the UK and the Euro zone still have the equivalent of 1-cent coins, so not everyone is moving in this direction.

Based on this penny news, I decided that it would be fun and interesting to look at coins around the world.

Data and seven questions

This week, our data will come from Numista (https://en.numista.com/), a site with numismatic (i.e., coin-related) information. The site is mainly aimed at coin collectors, including buyers and sellers. But it includes information about enough coins currently in use for our purposes.

In theory, we could query the Numista database enough to find the current value of various coins – but the API only allows for up to 2,000 free queries each month, and I didn't want to use up those queries, when you'll likely make some mistakes along the way, using up your API query count.

Learning goals for this week include working with APIs, JSON files, string processing, regular expressions, and grouping.

Paid subscribers can download the program I used to retrieve from the API at the end of this message. (You'll still need to register for your own API key, though!)

Here are my seven tasks and questions for this week. I'll be back tomorrow with my complete solutions and explanations: