Dataset Viewer
Duplicate
The dataset viewer is not available for this split.
Cannot extract the features (columns) for the split 'train' of the config 'default' of the dataset.
Error code:   FeaturesError
Exception:    UnicodeDecodeError
Message:      'utf-8' codec can't decode byte 0xe4 in position 1409: invalid continuation byte
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/split/first_rows.py", line 244, in compute_first_rows_from_streaming_response
                  iterable_dataset = iterable_dataset._resolve_features()
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 4408, in _resolve_features
                  features = _infer_features_from_batch(self.with_format(None)._head())
                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2679, in _head
                  return next(iter(self.iter(batch_size=n)))
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2861, in iter
                  for key, pa_table in ex_iterable.iter_arrow():
                                       ~~~~~~~~~~~~~~~~~~~~~~^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2395, in _iter_arrow
                  yield from self.ex_iterable._iter_arrow()
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 536, in _iter_arrow
                  for key, pa_table in iterator:
                                       ^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 419, in _iter_arrow
                  for key, pa_table in self.generate_tables_fn(**gen_kwags):
                                       ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/csv/csv.py", line 196, in _generate_tables
                  csv_file_reader = pd.read_csv(file, iterator=True, dtype=dtype, **self.config.pd_read_csv_kwargs)
                File "/usr/local/lib/python3.14/site-packages/datasets/streaming.py", line 73, in wrapper
                  return function(*args, download_config=download_config, **kwargs)
                File "/usr/local/lib/python3.14/site-packages/datasets/utils/file_utils.py", line 1279, in xpandas_read_csv
                  return pd.read_csv(xopen(filepath_or_buffer, "rb", download_config=download_config), **kwargs)
                         ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/pandas/io/parsers/readers.py", line 1026, in read_csv
                  return _read(filepath_or_buffer, kwds)
                File "/usr/local/lib/python3.14/site-packages/pandas/io/parsers/readers.py", line 620, in _read
                  parser = TextFileReader(filepath_or_buffer, **kwds)
                File "/usr/local/lib/python3.14/site-packages/pandas/io/parsers/readers.py", line 1620, in __init__
                  self._engine = self._make_engine(f, self.engine)
                                 ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/pandas/io/parsers/readers.py", line 1898, in _make_engine
                  return mapping[engine](f, **self.options)
                         ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/pandas/io/parsers/c_parser_wrapper.py", line 93, in __init__
                  self._reader = parsers.TextReader(src, **kwds)
                                 ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
                File "pandas/_libs/parsers.pyx", line 574, in pandas._libs.parsers.TextReader.__cinit__
                File "pandas/_libs/parsers.pyx", line 663, in pandas._libs.parsers.TextReader._get_header
                File "pandas/_libs/parsers.pyx", line 874, in pandas._libs.parsers.TextReader._tokenize_rows
                File "pandas/_libs/parsers.pyx", line 891, in pandas._libs.parsers.TextReader._check_tokenize_status
                File "pandas/_libs/parsers.pyx", line 2053, in pandas._libs.parsers.raise_parser_error
                File "<frozen codecs>", line 325, in decode
              UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 1409: invalid continuation byte

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Exploratory Data Analysis - Paavo Dataset

An exploratory data analysis (EDA) pipeline for Statistics Finland's Paavo open dataset, which provides area and municipality-level statistics on demographics, income levels, household structures, and building infrastructure across Finland.

Project Overview

This script processes the Paavo dataset to generate summary statistics, distribution plots, correlation analysis, and targeted visualizations for key metrics across top-ranking postal areas.

Key Analysis Features:

  • Data Cleaning: Strips whitespace from headers and excludes regional summary records (MK* rows, e.g., "MK01 Uusimaa").
  • Demographic Distributions: Analyzes key attributes such as total inhabitants, average/median income, average age, and household sizes.
  • Correlation Heatmap: Generates feature relationships across all numeric metrics.
  • Income & Household Breakdown: Evaluates distribution across lowest, middle, and highest income tiers for top population and household centers.
  • Density & Economic Power Metrics: Computes housing density proxies (inhabitants per residential building) and analyzes top regional purchasing power.

Directory Structure

β”œβ”€β”€ eda_script.py          # Main EDA script
β”œβ”€β”€ PaavoDataset.csv       # Source dataset (Statistics Finland)
└── eda_outputs/           # Output directory generated by script
    β”œβ”€β”€ summary_statistics.csv
    β”œβ”€β”€ 01_distributions.png
    β”œβ”€β”€ 02_correlation_heatmap.png
    β”œβ”€β”€ 03_income_categories_top20.png
    β”œβ”€β”€ 04_household_income_categories_top20.png
    β”œβ”€β”€ 05_inhabitants_per_building_top20.png
    └── 06_purchasing_power_top20.png

Prerequisites & Installation

Ensure you have Python 3.8+ installed along with the required dependencies:

pip install pandas matplotlib seaborn

Data Input Requirements

Place the raw dataset file PaavoDataset.csv in the root directory.

  • Format: Semicolon-separated values (sep=";")
  • Encoding: latin1
  • Key Columns Expected:
    • Area
    • Inhabitants, Average age of inhabitants, Average size of households
    • Average income of inhabitants, Median income of inhabitants
    • Inhabitants belonging to the lowest/middle/highest income category
    • Households, Households belonging to the lowest/middle/highest income category
    • Residential buildings, Accumulated purchasing power of inhabitants

Usage

Run the Python analysis script:

python eda_script.py

Generated Visualizations & Analytical Insights

Below are the detailed logical notes, observations, and conclusions derived from each generated plot:

1. 01_distributions.png - Key Demographic & Income Distributions

  • Inhabitants Distribution: Highly right-skewed. The vast majority of postal code areas have small populations, while a few urban hubs house large concentrations of people.
  • Average vs. Median Income: Average income typically exhibits a rightward tail compared to Median income, indicating income inequality where a small percentage of high earners elevates average regional figures.
  • Average Age & Household Size: Average age shows a normal to slightly multi-modal distribution, distinguishing university/younger urban areas from aging rural communities. Household sizes cluster tightly around 1.5 to 2.5 people per household, reflecting national trends of smaller urban households.

2. 02_correlation_heatmap.png - Feature Correlation Matrix

  • Population vs. Total Purchasing Power: Strong positive correlation between total Inhabitants / Households and Accumulated purchasing power, confirming that volume drives overall market size.
  • Income & Age Dynamics: Median income often correlates negatively with higher average age in rural regions, whereas prime working-age areas show elevated median income.
  • Housing vs. Population: High correlation between the number of residential units and population, though variations indicate differences in housing structures (apartment-heavy urban vs. single-family rural areas).

3. 03_income_categories_top20.png - Individual Income Composition (Top 20 Populated Areas)

  • Urban Middle-Class Dominance: Highly populated postal codes (e.g., major urban centers in Helsinki, Tampere, Oulu) show a large proportion of inhabitants falling into the middle-income tier.
  • Student & Young Professional Enclaves: Top areas containing major universities exhibit higher ratios of the lowest income category due to non-working student populations, despite high total population counts.

4. 04_household_income_categories_top20.png - Household Income Composition (Top 20 Household Areas)

  • Single-Person Household Impact: Household income distributions shift relative to individual income distributions because single-person households are more likely to fall into lower household-income brackets compared to dual-income families.
  • Socioeconomic Stratification: Comparing suburban centers against inner-city areas reveals clear differences: suburban hub areas tend to have larger shares of upper-tier household incomes, whereas dense inner-city postal codes show a higher volume of single-income and entry-level households.

5. 05_inhabitants_per_building_top20.png - Urban Housing Density

  • Multi-Storey Concentration: Dense urban postal codes dominate this metric, as high-rise residential complexes house significantly more people per single residential structure building footprint.
  • Infrastructure Demand: Areas ranking highest in inhabitants per building represent key focus zones for high-density municipal services, public transit routes, and commercial utility planning.

6. 06_purchasing_power_top20.png - Accumulated Purchasing Power

  • Market Size Drivers: Total purchasing power is heavily weighted toward high-population, high-income urban districts (primarily Uusimaa/Helsinki region).
  • Commercial Viability: While some areas may have lower average incomes, their high population density compensates to produce massive aggregate purchasing capacity (EUR), making them critical target zones for retail and enterprise expansion.

Summary of Output Artifacts

All outputs are exported to the eda_outputs/ directory:

Artifact Description
summary_statistics.csv Descriptive statistics (count, mean, std, min, quartiles, max) for numeric columns.
01_distributions.png Distribution plots with KDE curves for key demographic and income metrics.
02_correlation_heatmap.png Matrix correlation map across all numeric features.
03_income_categories_top20.png Stacked horizontal bar plot of income breakdown for top 20 areas by population.
04_household_income_categories_top20.png Stacked horizontal bar plot of household income breakdown for top 20 areas by households.
05_inhabitants_per_building_top20.png Bar chart of top 20 areas ranked by inhabitants per residential building.
06_purchasing_power_top20.png Bar chart of top 20 areas ranked by total accumulated purchasing power (EUR).
Downloads last month
44