Python 100 project #5: Japanese Living Abroad #1 -How Japanese are scattered around the world?

I’m going to explore some statistics. I have lived a few countries, and most of the time I saw some Japanese every around the corner. But their characteristics seems different area by area. In Singapore, many guys(usually single) came there to explore the second job, while in UK it seems there are two main parties, one is student and YMS visa holder, and the other is permanent resident. Through this study, I’m going to use some infographic to visualise these feelings.

First, population plot of Japanese people on 2016.

Output example:

As expected, US has the largest population of Japanese(of course outside Japan), Western Europe also has a large size. One thing to highlight is the size of South East Asia block. I thought there were lots of Japanese, but I had not expected so much people living in Thailand, which is considerably big almost the same as UK.


Code is here:

import folium
import pandas as pd
import requests

MyAPIKEY = "Google Geocode API key"

url = "{}&key={}"

population_map = folium.Map(location=[0.0, 0.0], zoom_start=3)

populations = pd.read_csv('data_source/nihon_toukei_population.csv')
for id, row in populations.iterrows():
    address = requests.compat.quote_plus(row['Address'])

    resp = requests.get(url.format(address, MyAPIKEY))
        location = [resp.json()['results'][0]['geometry']['location']['lat'], 
    except IndexError:
    folium.CircleMarker(location=location, radius=r['28_population']*200,
                        color = 'red',