Skip to content

Commit

Permalink
fix pr comment
Browse files Browse the repository at this point in the history
  • Loading branch information
dayesouza committed Oct 21, 2024
1 parent 42d120f commit f67a25a
Showing 1 changed file with 13 additions and 24 deletions.
37 changes: 13 additions & 24 deletions toolkit/compare_case_groups/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,19 @@ def get_dataset_proportion(self) -> int:
)

def _select_columns_ranked_df(self, ranked_df: pl.DataFrame) -> None:
lower_groups = [g.lower() for g in self.groups]

if self.temporal != "":
columns = [
*lower_groups,
"group_count",
"group_rank",
"attribute_value",
"attribute_count",
"attribute_rank",
f"{self.temporal}_window",
f"{self.temporal}_window_count",
f"{self.temporal}_window_rank",
f"{self.temporal}_window_delta",
]
else:
columns = [
*lower_groups,
"group_count",
"group_rank",
"attribute_value",
"attribute_count",
"attribute_rank",
]
columns = [g.lower() for g in self.groups]
default_columns = [
"group_count",
"group_rank",
"attribute_value",
"attrubite_count",
"attribute_rank",
]

columns.extend(default_columns)

if self.temporal:
columns.extend([f"{self.temporal}_window", ...])

self.model_df = ranked_df.select(columns)

Expand Down

0 comments on commit f67a25a

Please sign in to comment.