Fixed import de lf dans stats
This commit is contained in:
+1
-1
@@ -12,7 +12,7 @@ layout = [
|
|||||||
children=[
|
children=[
|
||||||
html.H2(title),
|
html.H2(title),
|
||||||
dcc.Markdown(
|
dcc.Markdown(
|
||||||
"""Outil développé par Colin Maudry, sous licence GPL v3 (libre et gratuit).
|
"""Outil d'exploration des [Données Essentielles de la Commande Publique](), développé par Colin Maudry, sous licence GPL v3 (libre et gratuit).
|
||||||
|
|
||||||
- [wiki du projet](https://github.com/ColinMaudry/decp-processing/wiki)
|
- [wiki du projet](https://github.com/ColinMaudry/decp-processing/wiki)
|
||||||
- [code source de decp.info](https://github.com/ColinMaudry/decp.info)
|
- [code source de decp.info](https://github.com/ColinMaudry/decp.info)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import plotly.express as px
|
|||||||
import polars as pl
|
import polars as pl
|
||||||
from dash import dcc, html, register_page
|
from dash import dcc, html, register_page
|
||||||
|
|
||||||
from src.utils import df
|
from src.utils import lf
|
||||||
|
|
||||||
title = "Statistiques"
|
title = "Statistiques"
|
||||||
|
|
||||||
@@ -12,11 +12,11 @@ register_page(
|
|||||||
__name__, path="/statistiques", title=f"decp.info - {title}", name=title, order=3
|
__name__, path="/statistiques", title=f"decp.info - {title}", name=title, order=3
|
||||||
)
|
)
|
||||||
|
|
||||||
df = df.with_columns(
|
lf = lf.with_columns(
|
||||||
pl.col("lieuExecution_code").str.head(2).str.zfill(2).alias("Département")
|
pl.col("lieuExecution_code").str.head(2).str.zfill(2).alias("Département")
|
||||||
)
|
)
|
||||||
df = (
|
lf = (
|
||||||
df.unique(subset="uid")
|
lf.unique(subset="uid")
|
||||||
.select(["uid", "Département"])
|
.select(["uid", "Département"])
|
||||||
.unique(subset="uid")
|
.unique(subset="uid")
|
||||||
.group_by("Département")
|
.group_by("Département")
|
||||||
@@ -30,6 +30,8 @@ with open("./data/departements-1000m.geojson") as f:
|
|||||||
for f in departements["features"]:
|
for f in departements["features"]:
|
||||||
f["id"] = f["properties"]["code"]
|
f["id"] = f["properties"]["code"]
|
||||||
|
|
||||||
|
df = lf.collect()
|
||||||
|
|
||||||
fig = px.choropleth(
|
fig = px.choropleth(
|
||||||
df,
|
df,
|
||||||
geojson=departements,
|
geojson=departements,
|
||||||
|
|||||||
Reference in New Issue
Block a user