From 9817f005cb0b438a051853a222ecfda2b96ede3f Mon Sep 17 00:00:00 2001 From: alexbarros Date: Tue, 26 Sep 2023 13:10:38 -0300 Subject: [PATCH] fix: to_category misshandling pd.NA --- src/ydata_profiling/model/typeset_relations.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ydata_profiling/model/typeset_relations.py b/src/ydata_profiling/model/typeset_relations.py index 831954c65..1a32526b0 100644 --- a/src/ydata_profiling/model/typeset_relations.py +++ b/src/ydata_profiling/model/typeset_relations.py @@ -52,6 +52,7 @@ def to_category(series: pd.Series, state: dict) -> pd.Series: val = series.astype(str) if hasnans: val = val.replace("nan", np.nan) + val = val.replace("", np.nan) return val.astype("string")