Skip to content

Commit

Permalink
temp solution for offer quality
Browse files Browse the repository at this point in the history
  • Loading branch information
yusufuyanik1 committed Dec 16, 2024
1 parent c4fff59 commit 6279aed
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/pdstools/decision_analyzer/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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],
Expand Down

0 comments on commit 6279aed

Please sign in to comment.