From 93627a860af56b6e257bf081468f050db0337eb6 Mon Sep 17 00:00:00 2001 From: sapountzis Date: Mon, 18 Dec 2023 10:00:06 +0200 Subject: [PATCH] fix pandas warning --- phik/phik.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phik/phik.py b/phik/phik.py index 90e29ab..ee70e13 100644 --- a/phik/phik.py +++ b/phik/phik.py @@ -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.