mirror of
https://github.com/koodiklinikka/palkkakysely.git
synced 2026-03-13 06:03:36 +00:00
Add 2025 survey data support
The 2025 survey uses a single English-only xlsx (instead of separate fi/en files) with a restructured schema: compensation is split into base salary, commission, lomaraha, bonus, and equity components; working time is h/week instead of percentage; and competitive salary is categorical instead of boolean. Vuositulot is now synthesized from the component fields. Drop COLUMN_MAP_2024, COLUMN_MAP_2024_EN_TO_FI, VALUE_MAP_2024_EN_TO_FI, read_initial_dfs_2024, read_data_2024, map_sukupuoli, map_vuositulot, split_boolean_column_to_other, apply_fixups, and the associated gender value lists and boolean text maps. All of this exists in version history. - KKPALKKA now includes base salary + commission (median 5500 → 5800) - Apply map_numberlike to tuntilaskutus and vuosilaskutus columns to handle string values like "60 000" and "100 000" - Filter out zeros when computing tunnusluvut on the index page so stats reflect actual reported values Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
{% extends "_base.html" %}
|
||||
{% macro eur_span(number) -%}
|
||||
<span title="{{ number }}" class="eur" data-number="{{ number }}">{{ number }} €</span>
|
||||
{%- endmacro %}
|
||||
{% macro tunnusluvut_points(df, col_name, title) %}
|
||||
{% with num_kk = df[pd.to_numeric(df[col_name], errors='coerce').notnull()][col_name] %}
|
||||
<li title="n = {{ num_kk.count() }}">{{ title }}, keskiarvo = {{ num_kk.mean()|round(0) }} €</li>
|
||||
<li title="n = {{ num_kk.count() }}">{{ title }}, mediaani = {{ num_kk.median()|round(0) }} €</li>
|
||||
{% with num_kk = df[col_name][pd.to_numeric(df[col_name], errors='coerce') > 0].dropna() %}
|
||||
<li title="n = {{ num_kk.count() }}">{{ title }}, keskiarvo = {{ eur_span(num_kk.mean()|round(0)) }}</li>
|
||||
<li title="n = {{ num_kk.count() }}">{{ title }}, mediaani = {{ eur_span(num_kk.median()|round(0)) }}</li>
|
||||
{% endwith %}
|
||||
{% endmacro %}
|
||||
{% block body %}
|
||||
@@ -74,6 +77,15 @@
|
||||
International</a> (CC BY 4.0).<br>
|
||||
Mankelointityökalujen lisenssi on <a href="https://opensource.org/licenses/MIT">MIT</a>.
|
||||
</p>
|
||||
<script>
|
||||
for (const eur of document.querySelectorAll(".eur")) {
|
||||
// Try to parse data-number, format as browser-native currency
|
||||
const number = parseFloat(eur.dataset.number);
|
||||
if (!isNaN(number)) {
|
||||
eur.textContent = number.toLocaleString("fi-FI", {style: "currency", currency: "EUR"});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% block footer %}
|
||||
<footer>
|
||||
|
||||
Reference in New Issue
Block a user