From 6279aedf342d9c6c60c4eb87226ae1a58ca10cd8 Mon Sep 17 00:00:00 2001 From: "Uyanik, Yusuf" Date: Mon, 16 Dec 2024 19:03:05 +0100 Subject: [PATCH] temp solution for offer quality --- python/pdstools/decision_analyzer/plots.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python/pdstools/decision_analyzer/plots.py b/python/pdstools/decision_analyzer/plots.py index d4ed8638..50e5c856 100644 --- a/python/pdstools/decision_analyzer/plots.py +++ b/python/pdstools/decision_analyzer/plots.py @@ -590,12 +590,17 @@ def offer_quality_piecharts( "only_irrelevant_actions", "has_no_offers", ] - df = ( + all_frames = ( df.group_by("pxEngagementStage") .agg(pl.sum(value_finder_names)) .collect() .partition_by("pxEngagementStage", as_dict=True) ) + # TODO Temporary solution to fit the pie charts into the screen, pick only first 5 stages + df = {} + NBADStages_FilterView = NBADStages_FilterView[:5] + for stage in NBADStages_FilterView[:5]: + df[(stage,)] = all_frames[(stage,)] if return_df: return df @@ -608,7 +613,7 @@ def offer_quality_piecharts( ) for i, stage in enumerate(NBADStages_FilterView): - plotdf = df[stage].drop("pxEngagementStage") + plotdf = df[(stage,)].drop("pxEngagementStage") fig.add_trace( go.Pie( values=list(plotdf.to_numpy())[0],