Data Preparation for National Culture Dashboard
This data science project develops and deploys an interactive visual dashboard to help scientists, researchers, leaders, and ordinary people to compare national cultures according to the Hofstede's six dimentional model of national culture. This accessible and friendly tool will help enbrace cultural diversity and inclusion and promote global connection and collaboration for sustainable peace and prosperity.
The Dashboard
Technologies Used
- Python
- Pandas
- Ployly & Ployly Express
- Dash
- Jupyter Notebook
Platforms Used
- deepnote.com (Free Cloud-based Python/Jupyter environment used for development)
- pythonanywhere.com (Free Cloud-based Python environment used for deplotment)
Data Sources Used
- ISO Country Codes
- National Culture Indexes
Step 1 - Install and Import Libraries
Step 2 - Load and Prepare Data
The ISO country code dataset contains 240 countries with country name, capital, contient, two-digit code, three-digit code, currency, language, area, and GDP. We primarily use ISO3 country codd to support choropleth map but other data elements can also be used in the dashboard to provide geographical, demographic, and socioeconomic information.
2.1 Load and Prepare ISO Country Code Dataset
Step 2.2 - Load and Prepare National Culture Data
Step 3 - Merge National Culture Data with Country Code Data
The country code (ctr) in National Culture Data is not based on ISO standard. We need to use ISO3 format country code for generating choropleth map. We merge the two datasets to incorporate the ISO3 country code.
We take multipl steps:
- First, merge based on the country name match. Name match takes the higher priority.
- Second, merge based on country code match for those unmatched countries.
- Since mataches based on code can be problemetic, we must eye-ball them to correct wrong matches
3.1 Merge Based on Country Name Match
3.2 Merge Based on Country Code Match
We take the unmatched rows to find match based on country code.
Step 4 - Save the Wide Dataframe to a File
Step 5 - Transform the Wide Dataframe to Long Format
We will use Pandas melt() function to accomplish this.
Step 6 - Save the Long Dataframe to a File
The End!