From 60a3d7d9b3691c2e563b2eb8bed773f443f9a71e Mon Sep 17 00:00:00 2001 From: mmaurostoffel <166130318+mmaurostoffel@users.noreply.github.com> Date: Thu, 9 Jan 2025 17:40:58 +0100 Subject: [PATCH] Little fixes for weekdays https://gitea.fhgr.ch/stoffelmauro/ConsultancyProject_2_ETL/issues/6 --- etl/src/data/etl_property_capacities_weekdays.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/etl/src/data/etl_property_capacities_weekdays.py b/etl/src/data/etl_property_capacities_weekdays.py index 56972ab..c16fcb2 100644 --- a/etl/src/data/etl_property_capacities_weekdays.py +++ b/etl/src/data/etl_property_capacities_weekdays.py @@ -25,10 +25,9 @@ def property_capacities_weekdays(id: int, scrapeDate: str): df_calendar = df_calendar.drop("dates") df_calendar = df_calendar.group_by(["weekday", "weekday_num"]).agg(pl.col("column_0").sum()) - df_calendar = df_calendar.with_columns((pl.col("column_0") / numWeeks).alias("column_0")) + df_calendar = df_calendar.with_columns((pl.col("column_0") / numWeeks * 100).alias("column_0")) df_calendar = df_calendar.sort('weekday_num') df_calendar = df_calendar.drop('weekday_num') - print(df_calendar) - result = {"scraping-date": scrapeDate, "weekday": df_calendar['weekday'].to_list(), 'capacities': df_calendar['column_0'].to_list()} + result = {"scraping-date": scrapeDate, "weekdays": df_calendar['weekday'].to_list(), 'capacities': df_calendar['column_0'].to_list()} return result \ No newline at end of file