From cb970f6c10a840ae66050a185b9c1190d0fe2cc0 Mon Sep 17 00:00:00 2001 From: Alex Barros Date: Wed, 27 Sep 2023 04:04:40 -0300 Subject: [PATCH] fix: to_category misshandling pd.NA (#1464) --- 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")