< Home
Week1-2: Tools¶
Since I'm interested in the relation between social development and FabLabs, I'll dive into data related to that area.
Data set¶
First, I'll try to see the data from "2025 Global Multidimensional Poverty Index (MPI) report" reported by UNDP.
Also, I'll use Fab Labs list from https://www.fablabs.io/.
Import data¶
I reffered code by Tsuchiya-san.
The data here seems better to use it for analyzing, so I will import the data.
import requests
import codecs
url = 'https://hdr.undp.org/sites/default/files/2025_HDR/HDR25_Composite_indices_complete_time_series.csv'
r = requests.get(url)
print(r.status_code) #通信状態のチェック
with open('./datasets/hdr25_original.csv','wb') as fd:
fd.write(r.content)
#def main():
# Shift_JIS file path
# hdr25_original_path = './datasets/hdr25_original.csv'
# UTF-8 file path
# hdr25_utf8_path = './datasets/hdr25_utf8.csv'
# Transfer to utf-8 and save
# fin = codecs.open(hdr25_original_path, "r", "cp932")
# fout_utf = codecs.open(hdr25_utf8_path, "w", "utf-8")
# for row in fin:
# fout_utf.write(row)
# fin.close()
# fout_utf.close()
#if __name__ == '__main__':
# main()
200
I will read it with Pandas
# Read Human Development Report 2025 (1990-2023 time series) data
path_hdr25 = "./datasets/hdr25.csv" #define dataset path
import pandas as pd #import Panda Library
import numpy as np #import Numpy
#df_hdr25 = pd.read_csv(path_hdr25, encoding='utf-8') <this occured an error
df_hdr25 = pd.read_csv(path_hdr25, encoding='utf-8', encoding_errors='ignore') #df = data flame = read dataset path "path_hdr25" defined above with panda
df_hdr25.fillna(0, inplace=True) #replace N/A to 0
df_hdr25 #show the data flame "df_hdr25" defined above
| iso3 | country | hdicode | region | hdi_rank_2023 | hdi_1990 | hdi_1991 | hdi_1992 | hdi_1993 | hdi_1994 | ... | pop_total_2014 | pop_total_2015 | pop_total_2016 | pop_total_2017 | pop_total_2018 | pop_total_2019 | pop_total_2020 | pop_total_2021 | pop_total_2022 | pop_total_2023 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | AFG | Afghanistan | Low | SA | 181.0 | 0.285 | 0.291 | 0.301 | 0.311 | 0.305 | ... | 32.792523 | 33.831764 | 34.700612 | 35.688935 | 36.743039 | 37.856121 | 39.068979 | 40.000412 | 40.578842 | 41.454761 |
| 1 | ALB | Albania | Very High | ECA | 71.0 | 0.654 | 0.638 | 0.622 | 0.624 | 0.629 | ... | 2.903749 | 2.898632 | 2.897867 | 2.898242 | 2.894231 | 2.885009 | 2.871954 | 2.849636 | 2.827608 | 2.811655 |
| 2 | DZA | Algeria | High | AS | 96.0 | 0.595 | 0.596 | 0.601 | 0.603 | 0.603 | ... | 39.205030 | 40.019529 | 40.850721 | 41.689299 | 42.505035 | 43.294546 | 44.042091 | 44.761099 | 45.477390 | 46.164219 |
| 3 | AND | Andorra | Very High | 0 | 32.0 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | ... | 0.073737 | 0.072174 | 0.072181 | 0.073762 | 0.075162 | 0.076473 | 0.077380 | 0.078364 | 0.079705 | 0.080856 |
| 4 | AGO | Angola | Medium | SSA | 148.0 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | ... | 27.160770 | 28.157798 | 29.183070 | 30.234839 | 31.297155 | 32.375633 | 33.451132 | 34.532429 | 35.635029 | 36.749906 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 201 | ZZG.ECA | Europe and Central Asia | 0 | 0 | 0.0 | 0.674 | 0.671 | 0.664 | 0.659 | 0.654 | ... | 237.933850 | 240.937124 | 243.649817 | 246.131011 | 248.450885 | 250.382485 | 252.050998 | 253.404866 | 251.911694 | 250.300624 |
| 202 | ZZH.LAC | Latin America and the Caribbean | 0 | 0 | 0.0 | 0.648 | 0.653 | 0.657 | 0.661 | 0.666 | ... | 608.767281 | 614.831634 | 620.753858 | 626.503607 | 632.005592 | 637.185739 | 641.737540 | 645.501309 | 649.425289 | 653.952733 |
| 203 | ZZI.SA | South Asia | 0 | 0 | 0.0 | 0.454 | 0.458 | 0.464 | 0.468 | 0.472 | ... | 1849.167918 | 1871.872058 | 1894.465346 | 1917.144604 | 1939.537762 | 1961.729204 | 1983.510394 | 2003.263428 | 2022.467288 | 2043.083160 |
| 204 | ZZJ.SSA | Sub-Saharan Africa | 0 | 0 | 0.0 | 0.405 | 0.409 | 0.408 | 0.411 | 0.413 | ... | 945.842319 | 971.462925 | 997.258713 | 1023.353059 | 1050.355450 | 1077.776785 | 1105.614070 | 1133.710593 | 1162.042581 | 1191.521675 |
| 205 | ZZK.WORLD | World | 0 | 0 | 0.0 | 0.608 | 0.611 | 0.614 | 0.617 | 0.620 | ... | 7347.587459 | 7436.429577 | 7524.460416 | 7611.536549 | 7695.833415 | 7777.189671 | 7852.891001 | 7920.440021 | 7987.545028 | 8057.957339 |
206 rows × 1112 columns
I also import Lab List
import requests
import json
import pandas as pd
url = 'https://api.fablabs.io/0/labs.json'
r = requests.get(url)
data = r.json()
df_lablist = pd.DataFrame(data)
df_lablist
| id | name | kind_name | parent_id | blurb | description | slug | avatar_url | header_url | address_1 | ... | postal_code | country_code | latitude | longitude | address_notes | phone | capabilities | activity_status | links | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 2386 | Al Jazri Lab | fab_lab | NaN | The Al Jazari Lab (Fabrication Lab) is named i... | The lab is equipped with cutting-edge technolo... | aljazrilab | http://fablabs.io.s3.amazonaws.com/2021/02/06/... | http://fablabs.io.s3.amazonaws.com/2021/02/06/... | House of Wisdom, Al Juraina 1 | ... | AE | NaN | NaN | Al Jazri Lab is located in Mezzanine Floor at ... | 0097165940000 | aljazrilab@houseofwisdom.ae | [three_d_printing, cnc_milling, circuit_produc... | active | [{'id': 31737, 'url': 'https://www.facebook.co... | |
| 1 | 17 | PiNG | fab_lab | NaN | None | None | ping | None | None | None | ... | 44000 | FR | 47.218371 | -1.553621 | None | None | None | [] | None | [{'id': 52, 'url': 'http://fablab.pingbase.net'}] |
| 2 | 20 | FabLab INSA Strasbourg | fab_lab | NaN | None | None | fablabinsastrasbourg | None | None | None | ... | 67000 | FR | 48.583148 | 7.747882 | None | None | None | [] | None | [{'id': 55, 'url': 'http://www.ideaslab.fr'}] |
| 3 | 2852 | FabLab Solidaire Orange Digital Center Côte d'... | fab_lab | 2791.0 | Le FabLab Solidaire de l’Orange Digital Center... | Basé sur le "faire" et le partage, le FabLab S... | fablabsolidaireorangedigitalcenterctedivoire | http://fablabs.io.s3.amazonaws.com/2024/01/12/... | http://fablabs.io.s3.amazonaws.com/2024/02/09/... | https://maps.app.goo.gl/AYZTpZ8RncKXq7WEA | ... | 11 BP 202 Abidjan 11 | CI | NaN | NaN | Orange Digital Center - Plateau Indénié, 5ème ... | +2252720345555 | fablabodcci@gmail.com | [three_d_printing, cnc_milling, laser, vinyl_c... | active | [{'id': 43112, 'url': 'https://www.facebook.co... |
| 4 | 2963 | FabLab Caxias do Sul | fab_lab | NaN | The FabLab Caxias is a Maker Space and a versa... | The Fabrication Laboratory (FabLab) at the Cax... | caxiasfablab | http://fablabs.io.s3.amazonaws.com/2025/03/18/... | http://fablabs.io.s3.amazonaws.com/2024/11/16/... | R. Avelino Antônio de Souza, 1730 | ... | 95043-700 | BR | -29.139272 | -51.171602 | +55 54 9 8116 0397 | fablab@caxias.ifrs.edu.br | [three_d_printing, cnc_milling, circuit_produc... | active | [{'id': 61302, 'url': 'https://integra.ifrs.ed... | |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 2683 | 13 | Fab Lab Egypt | fab_lab | NaN | The first official fab lab and community-run m... | Fab Lab Egypt (under the umbrella of San3a Tec... | fablabegypt | http://fablabs.io.s3.amazonaws.com/2018/03/02/... | http://fablabs.io.s3.amazonaws.com/2021/01/19/... | Villa 35 - 100 St. - Near Al Horia Square | ... | EG | 29.959218 | 31.252782 | +201017465650 | fablabegypt@san3atech.com | [three_d_printing, cnc_milling, circuit_produc... | active | [{'id': 48, 'url': 'https://www.facebook.com/f... | ||
| 2684 | 2348 | Martigues'FabLab | fab_lab | 228.0 | Initié par les Espaces Publics Numériques de l... | Présentation en vidéo : https://dai.ly/x87kfi5... | martiguesFabLab | http://fablabs.io.s3.amazonaws.com/2020/11/24/... | http://fablabs.io.s3.amazonaws.com/2021/10/18/... | Quai Lucien Toulmond | ... | 13500 | FR | 43.405296 | 5.051129 | EPN Maison de la Formation et de la Jeunesse | 0442494598 | epn@ville-martigues.fr | [three_d_printing, laser, vinyl_cutting] | active | [] |
| 2685 | 1730 | BISCAST ManFabLab | fab_lab | NaN | Naga's leading center of idea generation and s... | Formed between the partnership of Bicol State ... | biscastmanfablab | http://fablabs.io.s3.amazonaws.com/2018/06/01/... | http://fablabs.io.s3.amazonaws.com/2018/10/08/... | 98 Penafrancia Ave. | ... | 4400 | PH | 13.636209 | 123.199228 | biscast.manfablab@gmail.com | [three_d_printing, cnc_milling, laser, precisi... | active | [] | ||
| 2686 | 1587 | The Makerspace (previously TechWorks Amman) | fab_lab | NaN | The Makerspace is CPF’s flagship innovation pl... | The Makerspace (previously TechWorks) is CPF’s... | fablabjordan | http://fablabs.io.s3.amazonaws.com/2024/03/13/... | http://fablabs.io.s3.amazonaws.com/2021/01/20/... | King Hussein Business Park | ... | JO | 31.971558 | 35.832745 | Next to GROW Building side door entrance | 00962791000110 | info@techworks.jo | [three_d_printing, cnc_milling, circuit_produc... | active | [{'id': 29176, 'url': 'https://youtu.be/zLt3aO... | |
| 2687 | 2210 | FabLab L'Aquila | fab_lab | NaN | FabLabAQ is a group of people hold together by... | FabLab L’Aquila Association\r\n\r\nL'Aquila's ... | fablabaq | http://fablabs.io.s3.amazonaws.com/2020/02/07/... | http://fablabs.io.s3.amazonaws.com/2020/02/07/... | Via Giuseppe Mezzanotte | ... | 67100 | IT | 42.354660 | 13.413750 | +393927629526 | info@fablaquila.org | [three_d_printing, cnc_milling, circuit_produc... | active | [{'id': 30617, 'url': 'https://www.instagram.c... |
2688 rows × 23 columns
Visualization¶
Sample¶
Try to plot the data.
I checked matplotlib
import matplotlib.pyplot as plt
import numpy as np
plt.style.use('_mpl-gallery')
# make data
x = np.linspace(0, 10, 100)
y = 4 + 1 * np.sin(2 * x)
x2 = np.linspace(0, 10, 25)
y2 = 4 + 1 * np.sin(2 * x2)
# plot
fig, ax = plt.subplots()
ax.plot(x2, y2 + 2.5, 'x', markeredgewidth=2)
ax.plot(x, y, linewidth=2.0)
ax.plot(x2, y2 - 2.5, 'o-', linewidth=2)
ax.set(xlim=(0, 8), xticks=np.arange(1, 8),
ylim=(0, 8), yticks=np.arange(1, 8))
plt.show()
Graph for HDI (2023)¶
Then, try to make graphs from HDI report.
First, choose the data I need.
Human Development Index(HDI) and Life Expectancy¶
import matplotlib.pyplot as plt
x= df_hdr25['hdi_2023']
y = df_hdr25['le_2023']
plt.plot(x,y,'o')
plt.show()
HDI and Gross National Income Per Capita¶
import matplotlib.pyplot as plt
x= df_hdr25['hdi_2023']
y = df_hdr25['gnipc_2023']
plt.plot(x,y,'o')
plt.show()
HDI and Expected Years of Schooling¶
import matplotlib.pyplot as plt
x= df_hdr25['hdi_2023']
y = df_hdr25['eys_2023']
plt.plot(x,y,'o')
plt.show()
HDI and Mean Years of Schooling¶
import matplotlib.pyplot as plt
x= df_hdr25['hdi_2023']
y = df_hdr25['mys_2023']
plt.plot(x,y,'o')
plt.show()
Next, I world like to make list from 2 lists(hdi and lablist)
First, I learned I have to marge country code from these 2 lists.
Life Expectancy and Gross National Income Per Capita¶
import matplotlib.pyplot as plt
x= df_hdr25['le_2023']
y = df_hdr25['gnipc_2023']
plt.plot(x,y,'o')
plt.show()
Life Expectancy and Expected Years of Schooling¶
import matplotlib.pyplot as plt
x= df_hdr25['le_2023']
y = df_hdr25['eys_2023']
plt.plot(x,y,'o')
plt.show()
Life Expectancy and Mean Years of Schooling¶
import matplotlib.pyplot as plt
x= df_hdr25['le_2023']
y = df_hdr25['mys_2023']
plt.plot(x,y,'o')
plt.show()
Mean Years of Schooling and Gross National Income Per Capita¶
import matplotlib.pyplot as plt
x= df_hdr25['mys_2023']
y = df_hdr25['gnipc_2023']
plt.plot(x,y,'o')
plt.show()
HDI female and male¶
import matplotlib.pyplot as plt
x= df_hdr25['hdi_f_2023']
y = df_hdr25['hdi_m_2023']
plt.plot(x,y,'o')
plt.show()
Gender Development Index and Gender Inequality Index¶
import matplotlib.pyplot as plt
x= df_hdr25['gii_2023']
y = df_hdr25['gdi_2023']
plt.plot(x,y,'o')
plt.show()
Inequality in eduation and Inequality in income¶
import matplotlib.pyplot as plt
x= df_hdr25['ineq_inc_2023']
y = df_hdr25['ineq_edu_2023']
plt.plot(x,y,'o')
plt.show()
Graph for Lab List¶
count number¶
First, would like to know the number of Lab for each countries.
import requests
import json
import pandas as pd
url = 'https://api.fablabs.io/0/labs.json'
r = requests.get(url)
data = r.json()
df_lablist = pd.DataFrame(data)
country_code = df_lablist['country_code']
country_code
0 AE
1 FR
2 FR
3 CI
4 BR
..
2688 EG
2689 FR
2690 PH
2691 JO
2692 IT
Name: country_code, Length: 2693, dtype: object
df_labcount = df_lablist.groupby('country_code').count()
df_labcount['id']
country_code
AE 9
AF 1
AL 2
AM 2
AO 1
..
VE 3
VN 22
XK 1
YT 1
ZA 8
Name: id, Length: 144, dtype: int64
df_labno = (df_lablist.groupby('country_code').agg(lab_count=('id', 'count')).reset_index())
df_labno
| country_code | lab_count | |
|---|---|---|
| 0 | AE | 9 |
| 1 | AF | 1 |
| 2 | AL | 2 |
| 3 | AM | 2 |
| 4 | AO | 1 |
| ... | ... | ... |
| 139 | VE | 3 |
| 140 | VN | 22 |
| 141 | XK | 1 |
| 142 | YT | 1 |
| 143 | ZA | 8 |
144 rows × 2 columns
#print(df_labcount)
check with the Japan lab number¶
df_lablist.query('country_code == "JP"')
| id | name | kind_name | parent_id | blurb | description | slug | avatar_url | header_url | address_1 | ... | country_code | latitude | longitude | address_notes | phone | capabilities | activity_status | links | ccd3 | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 41 | 150 | Fablab Kamakura | fab_lab | NaN | blurb | Description.. | fablabkamakura | http://fablabs.io.s3.amazonaws.com/2018/06/02/... | http://fablabs.io.s3.amazonaws.com/2018/06/02/... | 1-10-6 | ... | JP | 35.321517 | 139.550148 | 1-10-6\r\n結の蔵 壱号室 | +81467384645 | info@fablabkamakura.com | [three_d_printing, cnc_milling, circuit_produc... | None | [{'id': 186, 'url': 'http://www.fablabkamakura... | JPN |
| 151 | 842 | FabLab Kyushu Univ. | fab_lab | NaN | kyushuuniv | None | None | Shiobal 4-9-1, Minami-ku, | ... | JP | 33.560650 | 130.430525 | Tenpaizaka 6-6-3,\r\nChikushino-shi | +81925534525 | k.tomimatsu2008@gmail.com | [three_d_printing, cnc_milling, circuit_produc... | planned | [] | JPN | ||
| 158 | 1501 | FabLab Setagaya at IID | fab_lab | NaN | “FabLab Setagaya at IID” is situated in a reno... | Tokyo is composed of 23 wards, and the one h... | fablabsetagaya | http://fablabs.io.s3.amazonaws.com/2017/07/29/... | http://fablabs.io.s3.amazonaws.com/2017/07/29/... | 池尻 | ... | JP | 35.646369 | 139.680888 | +81-3-6804-0200 | setafab@r-school.net | [three_d_printing, cnc_milling, circuit_produc... | active | [{'id': 4843, 'url': 'https://fablabsetagaya.c... | JPN | |
| 196 | 1053 | FabLab MinatoMirai - Kanagawa University | fab_lab | 150.0 | FabLab MinatoMirai is located in MinatoMirai C... | We started as Fablab Hiratsuka in 2014 and mov... | fablabminatomirai | http://fablabs.io.s3.amazonaws.com/2021/04/06/... | http://fablabs.io.s3.amazonaws.com/2021/04/06/... | 4-5-3 Minatomirai | ... | JP | 35.345079 | 139.260305 | +81-(0)45-664-3710(Operator) | fablab-minatomirai@kanagawa-u.ac.jp | [three_d_printing, cnc_milling, circuit_produc... | active | [{'id': 40043, 'url': 'https://www.kanagawa-u.... | JPN | |
| 369 | 499 | FABLAB Hamamatsu | fab_lab | NaN | FABLAB Hamamatsu is a lab located in Hamamatsu... | FABLAB Hamamatsu is a lab located in Hamamatsu... | fablabhamamatsu | http://fablabs.io.s3.amazonaws.com/2017/01/28/... | http://fablabs.io.s3.amazonaws.com/2017/01/28/... | 3645, Nishikamoe-cho, Nishi-ku | ... | JP | 34.710778 | 137.726108 | 5344854 | takespacehamamatsu@gmail.com | [three_d_printing, circuit_production, laser, ... | active | [{'id': 854, 'url': 'http://www.take-space.com'}] | JPN | |
| 371 | 331 | Fab Research Yokohama (Keio University) | fab_lab | 226.0 | This was a venue for FAB9 in 2013. Research Hub. | Known as SuperFabLab in FAB9. Social Fabricati... | fabresearchyokohamakeio | None | None | 神奈川県横浜市中区山下町223-1 NU関内ビル2F | ... | JP | 35.442563 | 139.641344 | [three_d_printing, cnc_milling, circuit_produc... | None | [{'id': 640, 'url': 'http://fabtechs.co'}] | JPN | |||
| 432 | 366 | FabLab SENDAI | fab_lab | NaN | Supported by Sendai city government.(2012-2017... | FabLab SENDAI – FLAT started not only as a “pl... | fablabsendai | http://fablabs.io.s3.amazonaws.com/2017/01/28/... | None | Ichiban-cho 2-2-8, Aoba-ku | ... | JP | 38.258777 | 140.875037 | +81-22-797-5384 | info@flatjp.com | [three_d_printing, cnc_milling, circuit_produc... | active | [{'id': 39763, 'url': 'https://linktr.ee/fabla... | JPN | |
| 442 | 161 | FabLab Tsukuba | fab_lab | NaN | FabLab Tsukuba is communication space for scie... | <h3>FPGA-CAFE was closed at Mar 2017. If you h... | fpgacafefablabtsukuba | http://fablabs.io.s3.amazonaws.com/2017/01/28/... | http://fablabs.io.s3.amazonaws.com/2017/01/28/... | Ritchmond 2 street | ... | JP | 36.098235 | 140.108313 | +81-3-6206-9275 | susu@susutawari.org | [three_d_printing, cnc_milling, circuit_produc... | closed | [{'id': 199, 'url': 'http://susutawari.org/'}] | JPN | |
| 544 | 226 | FabLab Kannai | fab_lab | NaN | FabLab Kannai is the 6th FabLab facility estab... | FabAcademy node since 2019 | fablabkannai | http://fablabs.io.s3.amazonaws.com/2022/06/14/... | None | 3-61-201 Aioi, Naka | ... | JP | 35.446611 | 139.637728 | 81+045-664-9009 | fablab@yokohamalab.jp | [three_d_printing, cnc_milling, circuit_produc... | active | [{'id': 39795, 'url': 'https://twitter.com/Fab... | JPN | |
| 578 | 157 | FabLab Kitakagaya | fab_lab | NaN | fablabkitakagaya | http://fablabs.io.s3.amazonaws.com/2017/10/29/... | None | 5-4-12 Kitakagaya | ... | JP | 34.623314 | 135.474568 | Coop Kitakagaya #107 | admin@fablabkitakagaya.org | [three_d_printing, cnc_milling, circuit_produc... | active | [{'id': 192, 'url': 'http://fablabkitakagaya.o... | JPN | |||
| 635 | 2798 | skylabworkshop | fab_lab | NaN | Skylabworkshop is a STEAM learning facility fo... | Located in the Zaimokuza neighborhood of Kamak... | skylabworkshop | http://fablabs.io.s3.amazonaws.com/2023/10/06/... | http://fablabs.io.s3.amazonaws.com/2023/10/06/... | 1-9-19 Zaimokuza | ... | JP | 35.307085 | 139.552187 | +8107012785371 | contact@skylabworkshop.tech | [three_d_printing, cnc_milling, circuit_produc... | active | [{'id': 42660, 'url': 'http://instagram.com/sk... | JPN | |
| 663 | 547 | FabLab DAZAIFU | fab_lab | NaN | fablabdazaifu | http://fablabs.io.s3.amazonaws.com/2017/01/28/... | http://fablabs.io.s3.amazonaws.com/2017/01/28/... | 2-19-30 Tofurominami | ... | JP | 33.508140 | 130.506275 | +81-92-923-8223 | info@fablabdazaifu.com | [three_d_printing, cnc_milling, circuit_produc... | None | [{'id': 941, 'url': 'http://fablabdazaifu.com/'}] | JPN | |||
| 945 | 2615 | FabLab Kuriyama | fab_lab | 150.0 | FabLab Kuriyama is Japan's northernmost govern... | FabLab Kuriyama is a public facility operated ... | fablabkuriyama | http://fablabs.io.s3.amazonaws.com/2022/08/07/... | http://fablabs.io.s3.amazonaws.com/2023/11/11/... | Kurihuto 1- 154 | ... | JP | 43.057581 | 141.777155 | The workshop is located on the far south side ... | 0123769945 | info@fablabkuriyama.jp | [three_d_printing, cnc_milling, circuit_produc... | active | [{'id': 39732, 'url': 'https://www.instagram.c... | JPN |
| 998 | 2823 | FabLab Yamaguchi | fab_lab | 150.0 | Let's get started! Make things your own size. | FabLab Yamaguchi is an open citizens' workshop... | fablabyamaguchi | None | None | 大殿大路133−1 | ... | JP | 34.182811 | 131.479790 | The street in front of the lab is one-way. | none | info@fablabyamaguchi.com | [three_d_printing, cnc_milling, circuit_produc... | active | [{'id': 42839, 'url': 'https://fablabyamaguchi... | JPN |
| 1014 | 1435 | Manazuru Tech Lab | fab_lab | NaN | Located in the small fishing town of Manazuru,... | We are located in the small fishing town of Ma... | manazuru | http://fablabs.io.s3.amazonaws.com/2017/05/02/... | http://fablabs.io.s3.amazonaws.com/2017/05/02/... | 894-1 Manatsuru | ... | JP | 35.153580 | 139.141330 | Second floor of Satoumi Base 里海ベース2階 | 080.3557.6968 | office@manazuru.net | [three_d_printing, cnc_milling, laser, precisi... | active | [{'id': 4638, 'url': 'http://www.manazuru.tech... | JPN |
| 1246 | 3074 | Fab Lab Nagoya | fab_lab | 499.0 | We are located in Nagoya city. You can reach u... | We are located in Nagoya city. You can reach u... | nagoya | http://fablabs.io.s3.amazonaws.com/2025/11/27/... | None | 1-183 Namiki Nakamura | ... | JP | 35.153721 | 136.851547 | 8866 | fablab@seeed.co.jp | [three_d_printing, cnc_milling, circuit_produc... | planned | [{'id': 62046, 'url': 'https://fablab-nagoya.o... | JPN | |
| 1336 | 653 | FabLab Saga | fab_lab | NaN | FabLab Saga will send the culture of Saga to t... | The 9th FabLab in Japan. Located on central ar... | fablabsaga | http://fablabs.io.s3.amazonaws.com/2017/01/28/... | http://fablabs.io.s3.amazonaws.com/2017/01/28/... | Gofukumotomachi 2-30, FabLab Saga | ... | JP | 33.253867 | 130.303536 | +81-952-97-7664 | fablab.saga@gmail.com | [three_d_printing, circuit_production, laser, ... | active | [{'id': 8009, 'url': 'http://www.fablab-saga.c... | JPN | |
| 1442 | 387 | Fab Lab Oita | fab_lab | NaN | FabLab Oita is a small lab in the center of Oi... | FabLab Oita is the 7th FabLab founded in Japan... | fablaboita | http://fablabs.io.s3.amazonaws.com/2025/01/13/... | http://fablabs.io.s3.amazonaws.com/2025/01/13/... | Chuomachi 1-1-19 | ... | JP | 33.235606 | 131.607176 | Go up the stairs to the third floor. | none | info@faboita.org | [three_d_printing, cnc_milling, laser, precisi... | active | [{'id': 718, 'url': 'http://www.faboita.org'}] | JPN |
| 1485 | 1251 | Ota Fab | fab_lab | 161.0 | We are a developer and manufacturer of the 3D ... | Our lab is owned by the 10 or more units of th... | otafab | http://fablabs.io.s3.amazonaws.com/2017/01/28/... | http://fablabs.io.s3.amazonaws.com/2017/01/28/... | Nishi-Kamata 7-4-4 | ... | JP | 35.563907 | 139.715810 | +81364287162 | mail@smls.link | [three_d_printing, laser] | active | [{'id': 2231, 'url': 'https://www.facebook.com... | JPN | |
| 1630 | 620 | FabLab tottori | fab_lab | 157.0 | fablabtottori | None | http://fablabs.io.s3.amazonaws.com/2017/01/28/... | 701-3 | ... | JP | 35.492441 | 134.234240 | +81-0857-30-7260 | fablab@ml.cjrd.tottori-u.ac.jp | [three_d_printing, cnc_milling, laser, precisi... | None | [{'id': 1064, 'url': 'http://www.fablab-tottor... | JPN | |||
| 1748 | 1522 | FabLab Nagano | fab_lab | 499.0 | Our lab is FabLab in the university establishe... | Our laboratory was established within Shinshu ... | fablabnagano | http://fablabs.io.s3.amazonaws.com/2017/09/10/... | http://fablabs.io.s3.amazonaws.com/2017/09/10/... | Faculty of Education,Shinshu University | ... | JP | 36.658118 | 138.179557 | http://fablab-nagano.org/access | +81-26-238-4175 | info@fablab-nagano.org | [three_d_printing, cnc_milling, circuit_produc... | active | [{'id': 4933, 'url': 'http://fablab-nagano.org... | JPN |
| 1830 | 2271 | FabLab Shinagawa | fab_lab | 226.0 | "A place of inclusion" is the key concept of o... | Our web site is https://fablab-shinagawa.org\r... | fablabshinagawa | None | http://fablabs.io.s3.amazonaws.com/2020/07/07/... | Nakanobu 4-6-15 | ... | JP | 35.605528 | 139.713219 | +81-3-6426-1967 | n_hamanaka@fablab-shinagawa.org | [three_d_printing, cnc_milling, circuit_produc... | active | [{'id': 12904, 'url': 'https://fablab-shinagaw... | JPN | |
| 1899 | 2929 | FabLab West-Harima | fab_lab | 157.0 | FabLab West Harima is based in Sayo-cho, locat... | FabLab West Harima started in March 2017 as a ... | fablabwestharima | http://fablabs.io.s3.amazonaws.com/2024/07/23/... | http://fablabs.io.s3.amazonaws.com/2024/07/23/... | 580 Kuchi-Nagatani | ... | JP | 35.035121 | 134.375474 | Fab Lab West-Harima is located on the site of ... | +818038357075 | info@fablab-nishiharima.org | [three_d_printing, cnc_milling, circuit_produc... | active | [{'id': 44611, 'url': 'https://www.facebook.co... | JPN |
| 2107 | 750 | ASIJ FabLab | fab_lab | NaN | The American School in Japan is opening a Desi... | The American School in Japan will be opening a... | asijfablab | http://fablabs.io.s3.amazonaws.com/2018/04/24/... | http://fablabs.io.s3.amazonaws.com/2018/04/24/... | 1-1-1 | ... | JP | 35.683755 | 139.524181 | schreiberm@gmail.com | [three_d_printing, cnc_milling, circuit_produc... | planned | [] | JPN | ||
| 2652 | 153 | FabLab KandaNishikicho (ex. FabLab Shibuya) | fab_lab | NaN | FabLab KandaNishikicho (ex. FabLab Shibuya) is... | We established Digital Fabrication Association... | fablabkn | http://fablabs.io.s3.amazonaws.com/2020/04/17/... | http://fablabs.io.s3.amazonaws.com/2018/10/16/... | 3-20 KandaNishikicho | ... | JP | 35.693726 | 139.760792 | +81(3) 5577 6959 | info@fablabkn.tokyo | [three_d_printing, cnc_milling, circuit_produc... | active | [{'id': 189, 'url': 'https://www.facebook.com/... | JPN |
25 rows × 24 columns
df_labno.query('country_code == "JP"')
| country_code | lab_count | |
|---|---|---|
| 66 | JP | 25 |
The row number and id number is same.
Sort by most¶
df_labnoorder = df_labno.sort_values('lab_count',ascending=False)
df_labnoorder
| country_code | lab_count | |
|---|---|---|
| 136 | US | 301 |
| 43 | FR | 294 |
| 17 | BR | 199 |
| 63 | IT | 194 |
| 39 | ES | 106 |
| ... | ... | ... |
| 94 | NE | 1 |
| 33 | DJ | 1 |
| 55 | HU | 1 |
| 107 | PS | 1 |
| 22 | CG | 1 |
144 rows × 2 columns
Make graph¶
import matplotlib.pyplot as plt
x = df_labnoorder['country_code']
y = df_labnoorder['lab_count']
plt.figure(figsize=(20, 6))
plt.bar(x,y)
plt.show()
Graph for HDI and Lab List¶
First, have to combine HDI List and Lab List.
# !pip install pycountry #install library ”pycountry”
import pycountry #import library
def alpha2_to_alpha3(code2): #define function(関数)”alpha2_to_alpha”, "code2" is a variable(変数) for 2 letter code (alpha2_to_alpha3 という関数を定義している,code2は「2文字の国コード」を受け取るための変数)
country = pycountry.countries.get(alpha_2=code2.upper()) #code2を大文字に変換し、pycountryから国コード合致しているものを探す。このことをcountryと定義
return country.alpha_3 if country else None #if found the country, return 3 letter code, otherwise retrun None 合致すれば3文字コードを返す、なければNoneと返す
# print(alpha2_to_alpha3("JP")) # JPN (JP を渡したときのテスト用コード)
# print(alpha2_to_alpha3("US")) # USA
# print(alpha2_to_alpha3("FR")) # FRA
ccd = country_code.to_list() #make Series(列)"country_code"in Panda to Python list(Panda上のcountry_code列を通常のPythonリストに変換、このことをccdと定義)
ccd3 = [] #prepare empty list (to put "3 letter code")3文字コードを入れるための空のリストを用意
for c in ccd: #ccd(=リスト化されたcountry_code(2桁)) の中身を1つずつ c に取り出す (ループ)
cc = alpha2_to_alpha3(c) #2文字コード c を、先ほど作った関数「alpha2_to_alpha3」(受け取った2文字コードに対してpycountryから合致しているものを探し、合致すれば3文字コードを返す)で3文字コードに変換
ccd3.append(cc) #変換した結果を ccd3 リストに追加
Marge 2 lists - 1.Lab No.¶
df_labno = df_lablist.groupby('country_code').agg(lab_count=('id', 'count')).reset_index()
df_labno['ccd3'] = df_labno['country_code'].apply(alpha2_to_alpha3)
df_merge2 = pd.merge(df_labno,df_hdr25,left_on='ccd3',right_on='iso3',how='left')
df_merge2
| country_code | lab_count | ccd3 | iso3 | country | hdicode | region | hdi_rank_2023 | hdi_1990 | hdi_1991 | ... | pop_total_2014 | pop_total_2015 | pop_total_2016 | pop_total_2017 | pop_total_2018 | pop_total_2019 | pop_total_2020 | pop_total_2021 | pop_total_2022 | pop_total_2023 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | AE | 9 | ARE | ARE | United Arab Emirates | Very High | AS | 15.0 | 0.713 | 0.724 | ... | 8.236875 | 8.674633 | 9.030873 | 9.234327 | 9.346870 | 9.377847 | 9.448524 | 9.789048 | 10.242086 | 10.642081 |
| 1 | AF | 1 | AFG | AFG | Afghanistan | Low | SA | 181.0 | 0.285 | 0.291 | ... | 32.792523 | 33.831764 | 34.700612 | 35.688935 | 36.743039 | 37.856121 | 39.068979 | 40.000412 | 40.578842 | 41.454761 |
| 2 | AL | 2 | ALB | ALB | Albania | Very High | ECA | 71.0 | 0.654 | 0.638 | ... | 2.903749 | 2.898632 | 2.897867 | 2.898242 | 2.894231 | 2.885009 | 2.871954 | 2.849636 | 2.827608 | 2.811655 |
| 3 | AM | 2 | ARM | ARM | Armenia | Very High | ECA | 69.0 | 0.663 | 0.652 | ... | 2.922422 | 2.921178 | 2.918792 | 2.914963 | 2.909965 | 2.903971 | 2.890893 | 2.870348 | 2.880875 | 2.943393 |
| 4 | AO | 1 | AGO | AGO | Angola | Medium | SSA | 148.0 | 0.000 | 0.000 | ... | 27.160770 | 28.157798 | 29.183070 | 30.234839 | 31.297155 | 32.375633 | 33.451132 | 34.532429 | 35.635029 | 36.749906 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 139 | VE | 3 | VEN | VEN | Venezuela (Bolivarian Republic of) | High | LAC | 121.0 | 0.658 | 0.669 | ... | 30.254079 | 30.573972 | 30.765721 | 30.565324 | 29.807592 | 28.938098 | 28.444077 | 28.237826 | 28.213016 | 28.300854 |
| 140 | VN | 22 | VNM | VNM | Viet Nam | High | EAP | 93.0 | 0.499 | 0.509 | ... | 91.679578 | 92.823254 | 94.000117 | 95.176977 | 96.237319 | 97.173776 | 98.079191 | 98.935098 | 99.680655 | 100.352192 |
| 141 | XK | 1 | None | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 142 | YT | 1 | MYT | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 143 | ZA | 8 | ZAF | ZAF | South Africa | High | SSA | 106.0 | 0.633 | 0.641 | ... | 55.594839 | 56.723537 | 57.259551 | 57.635162 | 58.613000 | 59.587885 | 60.562381 | 61.502603 | 62.378410 | 63.212384 |
144 rows × 1115 columns
Lab No and HDI¶
import matplotlib.pyplot as plt
x= df_merge2['hdi_2023']
y = df_merge2['lab_count']
#plt.figure(figsize=(8, 8))
plt.plot(x,y,'o')
plt.show()
Lab No and Life Expectancy¶
import matplotlib.pyplot as plt
x= df_merge2['le_2023']
y = df_merge2['lab_count']
#plt.figure(figsize=(8, 8))
plt.plot(x,y,'o')
plt.show()
Lab No and Mean Years of Schooling¶
import matplotlib.pyplot as plt
x= df_merge2['mys_2023']
y = df_merge2['lab_count']
#plt.figure(figsize=(8, 8))
plt.plot(x,y,'o')
plt.show()
Lab No and Gross National Income Per Capita¶
import matplotlib.pyplot as plt
x= df_merge2['gnipc_2023']
y = df_merge2['lab_count']
#plt.figure(figsize=(8, 8))
plt.plot(x,y,'o')
plt.show()
Lab No and Gender Development Index¶
import matplotlib.pyplot as plt
x= df_merge2['gdi_2023']
y = df_merge2['lab_count']
#plt.figure(figsize=(8, 8))
plt.plot(x,y,'o')
plt.show()
Lab No and Gender Inequality Index¶
import matplotlib.pyplot as plt
x= df_merge2['gii_2023']
y = df_merge2['lab_count']
#plt.figure(figsize=(8, 8))
plt.plot(x,y,'o')
plt.show()
Lab No and Inequality in eduation¶
import matplotlib.pyplot as plt
x= df_merge2['ineq_edu_2023']
y = df_merge2['lab_count']
#plt.figure(figsize=(8, 8))
plt.plot(x,y,'o')
plt.show()
Lab No and Inequality in income¶
import matplotlib.pyplot as plt
x= df_merge2['ineq_inc_2023']
y = df_merge2['lab_count']
#plt.figure(figsize=(8, 8))
plt.plot(x,y,'o')
plt.show()
import matplotlib.pyplot as plt
x= df_merge2['mf_2023']
y = df_merge2['lab_count']
#plt.figure(figsize=(8, 8))
plt.plot(x,y,'o')
plt.show()
Marge 2 lists - 2.Lab Type¶
I asked how to count labs depends on lab type.
df_kindcount = (
df_lablist
.groupby(['ccd3', 'kind_name'])
.agg(kind_count=('id', 'count'))
.reset_index()
)
df_kindcount
| ccd3 | kind_name | kind_count | |
|---|---|---|---|
| 0 | ABW | fab_lab | 1 |
| 1 | AFG | fab_lab | 1 |
| 2 | AGO | fab_lab | 1 |
| 3 | ALB | fab_lab | 2 |
| 4 | ARE | fab_lab | 7 |
| ... | ... | ... | ... |
| 237 | VEN | fab_lab | 1 |
| 238 | VEN | mini_fab_lab | 2 |
| 239 | VNM | fab_lab | 18 |
| 240 | VNM | mini_fab_lab | 4 |
| 241 | ZAF | fab_lab | 8 |
242 rows × 3 columns
df_kind_hdi = pd.merge(
df_kindcount,
df_hdr25,
left_on='ccd3',
right_on='iso3',
how='left'
)
df_kind_hdi
| ccd3 | kind_name | kind_count | iso3 | country | hdicode | region | hdi_rank_2023 | hdi_1990 | hdi_1991 | ... | pop_total_2014 | pop_total_2015 | pop_total_2016 | pop_total_2017 | pop_total_2018 | pop_total_2019 | pop_total_2020 | pop_total_2021 | pop_total_2022 | pop_total_2023 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | ABW | fab_lab | 1 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 1 | AFG | fab_lab | 1 | AFG | Afghanistan | Low | SA | 181.0 | 0.285 | 0.291 | ... | 32.792523 | 33.831764 | 34.700612 | 35.688935 | 36.743039 | 37.856121 | 39.068979 | 40.000412 | 40.578842 | 41.454761 |
| 2 | AGO | fab_lab | 1 | AGO | Angola | Medium | SSA | 148.0 | 0.000 | 0.000 | ... | 27.160770 | 28.157798 | 29.183070 | 30.234839 | 31.297155 | 32.375633 | 33.451132 | 34.532429 | 35.635029 | 36.749906 |
| 3 | ALB | fab_lab | 2 | ALB | Albania | Very High | ECA | 71.0 | 0.654 | 0.638 | ... | 2.903749 | 2.898632 | 2.897867 | 2.898242 | 2.894231 | 2.885009 | 2.871954 | 2.849636 | 2.827608 | 2.811655 |
| 4 | ARE | fab_lab | 7 | ARE | United Arab Emirates | Very High | AS | 15.0 | 0.713 | 0.724 | ... | 8.236875 | 8.674633 | 9.030873 | 9.234327 | 9.346870 | 9.377847 | 9.448524 | 9.789048 | 10.242086 | 10.642081 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 237 | VEN | fab_lab | 1 | VEN | Venezuela (Bolivarian Republic of) | High | LAC | 121.0 | 0.658 | 0.669 | ... | 30.254079 | 30.573972 | 30.765721 | 30.565324 | 29.807592 | 28.938098 | 28.444077 | 28.237826 | 28.213016 | 28.300854 |
| 238 | VEN | mini_fab_lab | 2 | VEN | Venezuela (Bolivarian Republic of) | High | LAC | 121.0 | 0.658 | 0.669 | ... | 30.254079 | 30.573972 | 30.765721 | 30.565324 | 29.807592 | 28.938098 | 28.444077 | 28.237826 | 28.213016 | 28.300854 |
| 239 | VNM | fab_lab | 18 | VNM | Viet Nam | High | EAP | 93.0 | 0.499 | 0.509 | ... | 91.679578 | 92.823254 | 94.000117 | 95.176977 | 96.237319 | 97.173776 | 98.079191 | 98.935098 | 99.680655 | 100.352192 |
| 240 | VNM | mini_fab_lab | 4 | VNM | Viet Nam | High | EAP | 93.0 | 0.499 | 0.509 | ... | 91.679578 | 92.823254 | 94.000117 | 95.176977 | 96.237319 | 97.173776 | 98.079191 | 98.935098 | 99.680655 | 100.352192 |
| 241 | ZAF | fab_lab | 8 | ZAF | South Africa | High | SSA | 106.0 | 0.633 | 0.641 | ... | 55.594839 | 56.723537 | 57.259551 | 57.635162 | 58.613000 | 59.587885 | 60.562381 | 61.502603 | 62.378410 | 63.212384 |
242 rows × 1115 columns
check with Japanese Lab
df_kind_hdi.query('country == "Japan"')
| ccd3 | kind_name | kind_count | iso3 | country | hdicode | region | hdi_rank_2023 | hdi_1990 | hdi_1991 | ... | pop_total_2014 | pop_total_2015 | pop_total_2016 | pop_total_2017 | pop_total_2018 | pop_total_2019 | pop_total_2020 | pop_total_2021 | pop_total_2022 | pop_total_2023 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 111 | JPN | fab_lab | 25 | JPN | Japan | Very High | 0 | 23.0 | 0.853 | 0.857 | ... | 127.486604 | 127.275873 | 127.159951 | 127.06469 | 126.913432 | 126.699423 | 126.304543 | 125.679338 | 124.997578 | 124.370947 |
1 rows × 1115 columns
Lab type and HDI¶
import matplotlib.pyplot as plt
x= df_kind_hdi['kind_name']
y = df_kind_hdi['hdi_2023']
#plt.figure(figsize=(8, 8))
plt.plot(x,y,'.')
plt.show()
Lab type and Mean Years of Schooling¶
import matplotlib.pyplot as plt
x= df_kind_hdi['kind_name']
y = df_kind_hdi['mys_2023']
#plt.figure(figsize=(8, 8))
plt.plot(x,y,'.')
plt.show()
Lab type and Inequality in eduation¶
import matplotlib.pyplot as plt
x= df_kind_hdi['kind_name']
y = df_kind_hdi['ineq_edu_2023']
#plt.figure(figsize=(8, 8))
plt.plot(x,y,'.')
plt.show()
Lab type and Inequality in income¶
import matplotlib.pyplot as plt
x= df_kind_hdi['kind_name']
y = df_kind_hdi['ineq_inc_2023']
#plt.figure(figsize=(8, 8))
plt.plot(x,y,'.')
plt.show()