< Home
DataScience Session 1: Introduction¶
Synopsis¶
Neil introduced the Fab Futures program and its first course: Data Science. He presented many examples of infographics and links to works of reference and interesting datasets. Surprise for me was the work by Florence Nightingale. My favourites are the Meinard map of Napoleon in Russian Winter (so much data, presented so clearly and still actual!) and the energy matrix called "US Energy Flow Super Sankey" by Otherlab.
Assignment¶
- Select and document a data set to analyze
- Connect to a JupyterLab server and become familiar with the user interface
A. Research ideas¶
- The dataset I selected is the list of fablabs, called labs.json, as can be downloaded via the https://fablabs.io website.
- For this specific dataset, I document the different fields/columns.
- I apply some techniques to get a first impression of the data; these techniques cann be applied to any dataset.
- I start cleaning this specific dataset and save it to a local CSV file.
B. Research planning and design¶
- read fablab register and document it
- review and plot the data
- clean the data
- plot some data
- change empty activity_status to "unknown"
- select most relevant fields/columns only
- skip all records for closed fablabs
- save the dataset to csv
Directories¶
Manually, we created the following directories:
- outputs (all outputs are written to this directory; this directory has been excluded from the repository)
Common modules¶
To facilitate the re-use of software, I placed some Python functions in fabmodules.py in the same directory as my Python notebooks. In this way all notebooks can use them. Use "import fabmodules as fm" to activate them.
# import python modules
import pandas as pd
import matplotlib.pyplot as plt
import fabmodules as fm
output_path = fm.output_path = "outputs/"
C. Data collection¶
Read fablab register as dataframe¶
The dataset we selected is the fablab register of "today", ie the labs.json export file from https://fablabs.io. We import it into a pandas dataframe.
# read fablab register into a pandas dataframe
url = "https://fablabs.io/labs.json?class=btn+btn-primary"
df = pd.read_json(url)
fm.log("fablabs ",url,df)
2025-12-16T18:14Z fablabs https://fablabs.io/labs.json?class=btn+btn-primary (2696, 23)
Show dataframe structure¶
# show dataframe structure and its size
df.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 2696 entries, 0 to 2695 Data columns (total 23 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 id 2696 non-null int64 1 name 2696 non-null object 2 kind_name 2696 non-null object 3 parent_id 918 non-null float64 4 blurb 2649 non-null object 5 description 2667 non-null object 6 slug 2696 non-null object 7 avatar_url 2179 non-null object 8 header_url 1708 non-null object 9 address_1 2668 non-null object 10 address_2 2666 non-null object 11 city 2696 non-null object 12 county 2696 non-null object 13 postal_code 2694 non-null object 14 country_code 2696 non-null object 15 latitude 2451 non-null float64 16 longitude 2451 non-null float64 17 address_notes 2667 non-null object 18 phone 2667 non-null object 19 email 2667 non-null object 20 capabilities 2696 non-null object 21 activity_status 2223 non-null object 22 links 2696 non-null object dtypes: float64(3), int64(1), object(19) memory usage: 484.6+ KB
Data Dictionary¶
The documentation of our dataset is a so-called data dictionary. We document all the columns (fields) of our dataset. In most cases it is enough to add a meaningful "Label" to eachof them. Where appropriate we give some additional comment.
The following picture shows the data dictionary for our dataset.
D. Data processing¶
We want to get some first impressions about the data in our dataset. Therefore we use some methods we could use for any dataset. Here we apply them to the fablabs.
Count unique values¶
We count the unique values in each column and analyze the columns where these unique numbers are max 20. In the fablabs case the columns kind_name has 3 unique values, the column activity_status has 6. For these columns we create barcharts
ChatGPT prompt: pandas: count the unique values in all columns of a dataframe; create a barchart of these figures; how to find the columns with not more than n different values; how to plot separate bar charts for these?
# count unique values in each column
def make_hashable(x):
if isinstance(x, (list, dict)):
return str(x)
return x
unique_counts = df.apply(lambda col: col.map(make_hashable).nunique(dropna=True))
# create bar chart
ax = unique_counts.plot(kind="bar", figsize=(10,5))
fm.label_bars(ax)
plt.title("Number of Unique Values per Column")
plt.xlabel("Column")
plt.ylabel("Unique value count")
plt.xticks(rotation=45, ha="right")
plt.tight_layout()
plt.show()
Create barcharts for columns with max 20 different values¶
# focus on the columns with less than x different values
maxnum = 20 # max number of different values in column
#✅ Step 1 — Count unique values per column (robust)
def make_hashable(x):
if isinstance(x, (list, dict)):
return str(x)
return x
unique_counts = df.apply(
lambda col: col.map(make_hashable).nunique(dropna=True)
)
# ✅ Step 2 — Find columns with ≤ 20 unique values
cols_le_maxnum = unique_counts[unique_counts <= maxnum].index.tolist()
print(cols_le_maxnum)
# ✅ Step 3 — Plot separate bar charts for these columns
for col in cols_le_maxnum:
counts = df[col].map(make_hashable).value_counts(dropna=False)
plt.figure(figsize=(6, 4))
ax = counts.plot(kind="bar")
fm.label_bars(ax)
plt.title(f"Value distribution: {col}")
plt.xlabel(col)
plt.ylabel("Count")
plt.xticks(rotation=45, ha="right")
plt.tight_layout()
plt.show()
['kind_name', 'activity_status']
Calculate statistics for numerical columns¶
We calculate some statistics on numerical columns. In the fablabs case, it concerns four columns. The statistical results are not very meaningfull in this case.
# show some dataframe statistics
df.describe()
| id | parent_id | latitude | longitude | |
|---|---|---|---|---|
| count | 2696.000000 | 918.000000 | 2451.000000 | 2451.000000 |
| mean | 1569.617953 | 725.663399 | 29.624157 | -1.136253 |
| std | 890.172753 | 677.779966 | 24.582534 | 62.173664 |
| min | 1.000000 | 2.000000 | -54.935210 | -158.057284 |
| 25% | 805.750000 | 166.500000 | 19.125337 | -49.072194 |
| 50% | 1582.500000 | 486.000000 | 39.845776 | 4.370654 |
| 75% | 2321.250000 | 1121.000000 | 46.335691 | 24.315401 |
| max | 3114.000000 | 3111.000000 | 69.576047 | 175.663262 |
Display some records (horizontally)¶
We display a list of records; ie the head and the tail of the list of fablabs.
# list a few records of the dataset
df
| 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... | |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 2691 | 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... | ||
| 2692 | 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 | [] |
| 2693 | 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 | [] | ||
| 2694 | 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... | |
| 2695 | 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... |
2696 rows × 23 columns
Display some records (vertically)¶
We also can display the records transposed (vertically). Sometimes that is more meaningful.
# list a few records of the dataset TRANSPOSED
df.T
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ... | 2686 | 2687 | 2688 | 2689 | 2690 | 2691 | 2692 | 2693 | 2694 | 2695 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | 2386 | 17 | 20 | 2852 | 2963 | 790 | 776 | 892 | 2868 | 1 | ... | 2331 | 663 | 214 | 2336 | 1108 | 13 | 2348 | 1730 | 1587 | 2210 |
| name | Al Jazri Lab | PiNG | FabLab INSA Strasbourg | FabLab Solidaire Orange Digital Center Côte d'... | FabLab Caxias do Sul | Drone Lab Brasil | Fab Lab Lleida | FABLAB KERALA - Trivandrum | Ostriv Platform | Fab Lab Afghanistan | ... | FabLab_du_Rocher | Confluence Fablab | Fablab Tainan | Konk Ar Lab | Fablab STMC | Fab Lab Egypt | Martigues'FabLab | BISCAST ManFabLab | The Makerspace (previously TechWorks Amman) | FabLab L'Aquila |
| kind_name | fab_lab | fab_lab | fab_lab | fab_lab | fab_lab | mini_fab_lab | fab_lab | fab_lab | fab_lab | fab_lab | ... | fab_lab | fab_lab | fab_lab | fab_lab | fab_lab | fab_lab | fab_lab | fab_lab | fab_lab | fab_lab |
| parent_id | NaN | NaN | NaN | 2791.0 | NaN | NaN | NaN | NaN | 1490.0 | NaN | ... | NaN | NaN | NaN | 1087.0 | 214.0 | NaN | 228.0 | NaN | NaN | NaN |
| blurb | The Al Jazari Lab (Fabrication Lab) is named i... | None | None | Le FabLab Solidaire de l’Orange Digital Center... | The FabLab Caxias is a Maker Space and a versa... | Laboratory specialized in using the Drone as a... | Help the community around us to develop social... | With the support of Government of Kerala, KSUM... | Welcome to Ostriv Platform! Our space is divid... | None | ... | A FabLab in the center of Paris (France), dedi... | Full CAD suite of software (Autodesk, Solidwor... | Fab Lab Tainan was founded at Dec. 2013 at Tai... | Konk Ar Lab, le FabLab de la Baie, est un FabL... | Fablab STMC(Southern Taiwan Maker Center)found... | The first official fab lab and community-run m... | Initié par les Espaces Publics Numériques de l... | Naga's leading center of idea generation and s... | The Makerspace is CPF’s flagship innovation pl... | FabLabAQ is a group of people hold together by... |
| description | The lab is equipped with cutting-edge technolo... | None | None | Basé sur le "faire" et le partage, le FabLab S... | The Fabrication Laboratory (FabLab) at the Cax... | Drone Lab Brasil was born as part of the Miran... | We are looking for a location for our lab. | With the support of Government of Kerala, KSUM... | Welcome to Ostriv Platform! Our space is divid... | None | ... | A FabLab in the center of Paris (France), dedi... | Confluence fablab is located just outside St. ... | We are Fablab Tainan, one of the main Fablabs ... | Konk Ar Lab est une association loi 1901 créée... | As a response to the concept of “social design... | Fab Lab Egypt (under the umbrella of San3a Tec... | Présentation en vidéo : https://dai.ly/x87kfi5... | Formed between the partnership of Bicol State ... | The Makerspace (previously TechWorks) is CPF’s... | FabLab L’Aquila Association\r\n\r\nL'Aquila's ... |
| slug | aljazrilab | ping | fablabinsastrasbourg | fablabsolidaireorangedigitalcenterctedivoire | caxiasfablab | dronelabbrasil | fablablleida | fablabkeralatrivandrum | ostrivplatform | fablabafghanistan | ... | fablabdurocher | confluencefablab | fablabtainan | konkarlab | fablabstmc | fablabegypt | martiguesFabLab | biscastmanfablab | fablabjordan | fablabaq |
| avatar_url | http://fablabs.io.s3.amazonaws.com/2021/02/06/... | None | None | http://fablabs.io.s3.amazonaws.com/2024/01/12/... | http://fablabs.io.s3.amazonaws.com/2025/03/18/... | http://fablabs.io.s3.amazonaws.com/2020/05/25/... | http://fablabs.io.s3.amazonaws.com/2017/01/28/... | http://fablabs.io.s3.amazonaws.com/2018/08/01/... | None | None | ... | http://fablabs.io.s3.amazonaws.com/2020/11/01/... | http://fablabs.io.s3.amazonaws.com/2017/01/28/... | http://fablabs.io.s3.amazonaws.com/2017/01/28/... | http://fablabs.io.s3.amazonaws.com/2020/11/09/... | http://fablabs.io.s3.amazonaws.com/2017/01/28/... | http://fablabs.io.s3.amazonaws.com/2018/03/02/... | http://fablabs.io.s3.amazonaws.com/2020/11/24/... | http://fablabs.io.s3.amazonaws.com/2018/06/01/... | http://fablabs.io.s3.amazonaws.com/2024/03/13/... | http://fablabs.io.s3.amazonaws.com/2020/02/07/... |
| header_url | http://fablabs.io.s3.amazonaws.com/2021/02/06/... | None | None | http://fablabs.io.s3.amazonaws.com/2024/02/09/... | http://fablabs.io.s3.amazonaws.com/2024/11/16/... | http://fablabs.io.s3.amazonaws.com/2020/05/25/... | None | http://fablabs.io.s3.amazonaws.com/2020/11/05/... | None | None | ... | http://fablabs.io.s3.amazonaws.com/2020/11/01/... | http://fablabs.io.s3.amazonaws.com/2017/01/28/... | http://fablabs.io.s3.amazonaws.com/2021/01/01/... | http://fablabs.io.s3.amazonaws.com/2021/01/18/... | http://fablabs.io.s3.amazonaws.com/2017/01/28/... | http://fablabs.io.s3.amazonaws.com/2021/01/19/... | http://fablabs.io.s3.amazonaws.com/2021/10/18/... | http://fablabs.io.s3.amazonaws.com/2018/10/08/... | http://fablabs.io.s3.amazonaws.com/2021/01/20/... | http://fablabs.io.s3.amazonaws.com/2020/02/07/... |
| address_1 | House of Wisdom, Al Juraina 1 | None | None | https://maps.app.goo.gl/AYZTpZ8RncKXq7WEA | R. Avelino Antônio de Souza, 1730 | Avenida Brigadeiro luis Antonio, 580 | Kerala Startup Mission (KSUM) | Volynska Street, 9/21, Kyiv, Україна | Jalalabad, Afghanistan | ... | 230 Rue du Faubourg Saint-Honoré | NO Nelson - N7 | No. 10-1, Ln. 197, Yule St., East Dist. | 2 Rue des Charmes | No.32, Datong Rd. | Villa 35 - 100 St. - Near Al Horia Square | Quai Lucien Toulmond | 98 Penafrancia Ave. | King Hussein Business Park | Via Giuseppe Mezzanotte | |
| address_2 | None | None | 5º andar | Ground floor IIITM-K building , Technopark Campus | None | ... | B2 | Dans l'enceinte de l'école primaire | Sinying Dist. | Maadi | 1st floor, College of Engineering and Architec... | Building 23 | C/O IIS "Amedeo D'Aosta | ||||||||
| city | Nantes | Strasbourg | Abidjan | Caxias do Sul | São Paulo | Lérida | Trivandrum | Kyiv | Jalalabad | ... | Paris | Edwardsville | Tainan City | Concarneau | Tainan City | Cairo | Martigues | Naga City | Amman | L'Aquila | |
| county | Sharjah | Pays de la Loire | Alsace | Abidjan/Plateau/Indénié | Rio Grande do Sul | São Paulo | Lleida | KERALA | Ukraine | Nangarhar | ... | Illinois | Taiwan | Bretagne | Cairo | Bouches du Rhône | Camarines Sur | Jordan | L'Aquila | ||
| postal_code | 44000 | 67000 | 11 BP 202 Abidjan 11 | 95043-700 | 01318-000 | 699581 | 03151 | None | ... | 75008 | 62025 | 701 | 29900 | 73048 | 13500 | 4400 | 67100 | ||||
| country_code | AE | FR | FR | CI | BR | BR | ES | IN | UA | AF | ... | FR | US | TW | FR | TW | EG | FR | PH | JO | IT |
| latitude | NaN | 47.218371 | 48.583148 | NaN | -29.139272 | -23.542037 | 41.623023 | 8.557167 | 50.430186 | 34.434469 | ... | 48.876448 | 38.806278 | 22.993373 | 47.88356 | 23.130636 | 29.959218 | 43.405296 | 13.636209 | 31.971558 | 42.35466 |
| longitude | NaN | -1.553621 | 7.747882 | NaN | -51.171602 | -46.6358 | 0.625864 | 76.880297 | 30.451312 | 70.448505 | ... | 2.303581 | -89.949941 | 120.215284 | -3.915601 | 120.290958 | 31.252782 | 5.051129 | 123.199228 | 35.832745 | 13.41375 |
| address_notes | Al Jazri Lab is located in Mezzanine Floor at ... | None | None | Orange Digital Center - Plateau Indénié, 5ème ... | perto do metro Sé | None | ... | The lab must be entered through the Southeast ... | EPN Maison de la Formation et de la Jeunesse | Next to GROW Building side door entrance | |||||||||||
| phone | 0097165940000 | None | None | +2252720345555 | +55 54 9 8116 0397 | +5511971835193 | +34 660493352 | +91 9809494669 | tel:+380631537951 | None | ... | +33180984657 | 618 468 5941 | 886-6-2212245 | 0256100304 | 886-6-6356583 | +201017465650 | 0442494598 | 00962791000110 | +393927629526 | |
| aljazrilab@houseofwisdom.ae | None | None | fablabodcci@gmail.com | fablab@caxias.ifrs.edu.br | contato@dronelab.com.br | fablablleida@gmail.com | fablab@startupmission.in | mailto:ostrivplatform@gmail.com | None | ... | fablab@coursdurocher.fr | info.stlcfl@lc.edu | fablabtainan@gmail.com | contact@konkarlab.bzh | stmakercenter@gmail.com | fablabegypt@san3atech.com | epn@ville-martigues.fr | biscast.manfablab@gmail.com | info@techworks.jo | info@fablaquila.org | |
| capabilities | [three_d_printing, cnc_milling, circuit_produc... | [] | [] | [three_d_printing, cnc_milling, laser, vinyl_c... | [three_d_printing, cnc_milling, circuit_produc... | [three_d_printing, circuit_production, laser, ... | [three_d_printing, cnc_milling, circuit_produc... | [three_d_printing, cnc_milling, circuit_produc... | [three_d_printing, cnc_milling, circuit_produc... | [] | ... | [three_d_printing, laser, vinyl_cutting] | [three_d_printing, cnc_milling, circuit_produc... | [three_d_printing, cnc_milling, circuit_produc... | [three_d_printing, cnc_milling, laser, vinyl_c... | [three_d_printing, cnc_milling, circuit_produc... | [three_d_printing, cnc_milling, circuit_produc... | [three_d_printing, laser, vinyl_cutting] | [three_d_printing, cnc_milling, laser, precisi... | [three_d_printing, cnc_milling, circuit_produc... | [three_d_printing, cnc_milling, circuit_produc... |
| activity_status | active | None | None | active | active | active | planned | active | active | None | ... | active | active | active | active | None | active | active | active | active | active |
| links | [{'id': 31737, 'url': 'https://www.facebook.co... | [{'id': 52, 'url': 'http://fablab.pingbase.net'}] | [{'id': 55, 'url': 'http://www.ideaslab.fr'}] | [{'id': 43112, 'url': 'https://www.facebook.co... | [{'id': 61302, 'url': 'https://integra.ifrs.ed... | [{'id': 11077, 'url': 'https://www.instagram.c... | [{'id': 2145, 'url': 'http://www.fablablleida.... | [{'id': 1563, 'url': 'http://www.startupmissio... | [{'id': 43268, 'url': 'https://ostrivplatform.... | [{'id': 179, 'url': 'http://www.fablab.af'}] | ... | [{'id': 19805, 'url': 'http://www.petitcoursdu... | [] | [{'id': 2131, 'url': 'http://www.fablabtainan.... | [{'id': 20556, 'url': 'https://www.konkarlab.b... | [{'id': 1968, 'url': 'http://southmaker.wda.go... | [{'id': 48, 'url': 'https://www.facebook.com/f... | [] | [] | [{'id': 29176, 'url': 'https://youtu.be/zLt3aO... | [{'id': 30617, 'url': 'https://www.instagram.c... |
23 rows × 2696 columns
# maybe some values are empty; replace them by "unknown"
df["activity_status"] = df["activity_status"].replace("","unknown")
df['activity_status'] = df['activity_status'].fillna('unknown')
Remove records with activity_status == "closed"¶
# remove records you are not interested in; eg remove closed fablabs
print(df.shape)
df = df[df["activity_status"]!="closed"]
print(df.shape)
(2696, 23) (2603, 23)
Remove any fields you are not interested in¶
# use only fields you are interested in
print(df.shape)
columnlist = "slug,name,kind_name,activity_status,country_code,city".split(",")
df = df[columnlist]
print(df.shape)
df.info()
(2603, 23) (2603, 6) <class 'pandas.core.frame.DataFrame'> Index: 2603 entries, 0 to 2695 Data columns (total 6 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 slug 2603 non-null object 1 name 2603 non-null object 2 kind_name 2603 non-null object 3 activity_status 2603 non-null object 4 country_code 2603 non-null object 5 city 2603 non-null object dtypes: object(6) memory usage: 142.4+ KB
fm.plotbarchart(df,"activity_status")
# save the resulting dataframe for future use
df.to_csv(output_path+"dataframe.csv", index = False)
df.shape
(2603, 6)
# at any time you can read this file back into pandas
df1 = pd.read_csv(output_path+"dataframe.csv")
df1.shape
(2603, 6)
Create a combined fabnetdata.xlsx¶
Use the MONTHLY - Create FABNETDATA workbook to create an excel workbook with separate sheets for fablabs, fabcities, countries and continents, plus their data dictionaries. The Notebook combines data collection, data cleaning and running statistics. The WG Fablabs and SDGs runs it on the first day of every calendar month and stores the resulting fabnetdata.xlsx in the public folder of the repository. However, you can also run the notebook yourself at any time you want.
Read the combined fabnetdata.xlsx¶
Use the read_fabnetdata module in fabmodules.py to read an existing fabnetdata.xlsx file and disassemble it into dataframes fablabs, fabcities, countries, continents; it clearly states the original data retrieval date. TRY!
# Read fabnetdata.xlsx
# read fabnetdata
fablabs, fabcities, countries, continents, retrieved = fm.read_fabnetdata("fabnetdata.xlsx")
url https://gitlab.fabcloud.org/fl-management/fablab-network-data/-/raw/main/public/fabnetdata.xlsx fablabs (2597, 29) fabcities (56, 7) countries (250, 44) continents (7, 35) data retrieved 2025-12-01
Evaluation and Follow-up¶
I used ChatGPT for adhoc assistance with smaller coding issues. The software for barplots was a collaborative effort.
Follow-up¶
- Solve the missing "NA" strings issue when exporting a dataset to CSV and importing it again ("NA"returns as NaN).
- Create a python function for a quick and dirty first review of a dataset (a combi of the activities practices above).
- Figure out how the fabmodules.py module could be made avalable outside the current directory (Jupyter requires a copy in the same directory as the calling notebook).