Why Are There So Many Country Codes? (And How to Convert Them Easily)

Yesterday, I was (somewhat reluctantly) forced to watch a few minutes of the Switzerland vs Finland match (congratulations to Switzerland, by the way!). As I glanced at the screen, I noticed something odd: Switzerland was abbreviated as SUI. That immediately caught my attention, because SUI is not the official ISO 3166-1 alpha-3 code for Switzerland.

Curious? Check it yourself: ISO 3166-1 alpha-3 codes on Wikipedia

It turns out that FIFA, the international football association, uses its own set of country codes. And, just to make things even more interesting, these codes are also different from the ones used by the International Olympic Committee (IOC).

Why Does This Matter?

If you work with international data—whether in sports, research, or business—these inconsistencies can quickly become a headache. Converting between ISO, FIFA, and IOC codes (and others!) is a common but surprisingly tricky problem.

A Solution: The country_converter Package

To make life easier, I’ve been working on the country_converter (coco) package. And as of today (version 1.3.1), coco now supports FIFA country codes as well!

With coco, you can easily convert between:

  • ISO 3166-1 alpha-3 codes

  • FIFA country codes

  • IOC country codes

  • ...and many more!

Check it out on GitHub: https://github.com/IndEcol/country_converter

My code in ice

My Code Is Now Preserved in the Arctic for 1,000 Years

I recently discovered something pretty remarkable: two of the open-source projects I started, country_converter and pymrio, have been archived in the GitHub Arctic Code Vault. This means that snapshots of my code are now stored on archival film, sealed in a vault 250 meters deep within a mountain in Svalbard, Norway, designed to last for at least 1,000 years.

Read more…

EXIOBASE update: v3.8

We just released a new update for the EXIOBASE 3 MRIO time-series of monetary tables: v3.8.

It is a full re-estimate of the time-series, but still relies heavily on "now-casting" economic structure (and environmental extensions).

Read more…

Sentiment Analysis with VADER

Sentiment Analysis with VADER

Sentiment analysis estimates whether whether a piece of text is negative, neutral or positive. There are two approaches towards sentiment analysis: binary or polarity based or intensity/valence based. The polarity based only provides information if a certain text is postive or negative. For example, 'good' and 'perfect' would score the same. In contrast, a valence based sentiment analysis also takes the intensity of a word into account, therefore giving a higher value to 'perfect' in the example above.

One of the major applications of sentiment analysis is judge social media streams (Twitter, facebook posts). For example, companies use it to identify negative feedbacks on social media and react/answer to them.

Read more…

Live streaming tweet for hashtags

Streaming of tweets for hashtags and keywords

This notebook explains how to search the live twitter stream for certain hashtags and keywords. The gathered tweets are stored as text files and further processed into a panda DataFrame.

The script is designed for long term streaming with gathered tweets stored in succeeding files.

Read more…