Skip to content

Commit

Permalink
Fix pandas deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
aazuspan committed Mar 6, 2024
1 parent 876c5a2 commit 78269f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sankee/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def generate_dataframe(self) -> pd.DataFrame:
.rename(columns={0: "changed"})
)
# Count the total number of source samples in each year
df["total"] = df.groupby(["source_year", "source"]).changed.transform(sum)
df["total"] = df.groupby(["source_year", "source"]).changed.transform("sum")
# Calculate what percent of the source samples went into each target class
df["proportion"] = df["changed"] / df["total"]

Expand Down Expand Up @@ -312,7 +312,7 @@ def toggle_button(button):
button.toggle()

class_name = button.tooltip
class_id = [key for key in self.labels.keys() if self.labels[key] == class_name][0]
class_id = next(key for key in self.labels.keys() if self.labels[key] == class_name)

if not button.state:
self.hide.append(class_id)
Expand Down

0 comments on commit 78269f4

Please sign in to comment.