First commit of claude's rework in django + vanillajs fronted

This commit is contained in:
Gérald Colangelo
2026-04-02 11:24:30 +02:00
parent 7710a876df
commit fde92f92db
163 changed files with 84852 additions and 15 deletions

View File

@@ -0,0 +1,30 @@
import pandas as pd
def compute_overall_stats(df: pd.DataFrame) -> dict:
s = df["speed"]
return {
"min_speed": s.min(),
"max_speed": s.max(),
"mean_speed": s.mean(),
"std_speed": s.std(ddof=1),
"count": len(df),
}
def compute_group_stats(groups: list) -> list:
result = []
for i, g in enumerate(groups):
s = g["speed"]
std = s.std(ddof=1) if len(g) > 1 else None
result.append({
"group_index": i + 1,
"count": len(g),
"min_speed": s.min(),
"max_speed": s.max(),
"mean_speed": s.mean(),
"std_speed": std,
"time_start": g["time"].min().strftime("%H:%M:%S"),
"time_end": g["time"].max().strftime("%H:%M:%S"),
})
return result