Skip to content

Commit

Permalink
Merge pull request #74 from sapountzis/bugfix/pandas_warning
Browse files Browse the repository at this point in the history
fix pandas warning
  • Loading branch information
mbaak authored Dec 29, 2023
2 parents e2871a4 + 93627a8 commit 0dd3553
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion phik/phik.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def _calc_phik(
if c0 == c1:
return c0, c1, 1.0

datahist = data_binned.groupby([c0, c1])[c0].count().to_frame().unstack().fillna(0)
datahist = data_binned.groupby([c0, c1], observed=False)[c0].count().to_frame().unstack().fillna(0)

# If 0 or only 1 values for one of the two variables, it is not possible to calculate phik.
# This check needs to be done after creation of OF, UF and NaN bins.
Expand Down

0 comments on commit 0dd3553

Please sign in to comment.