From 602721ce6fe94a4ac4e5316b473793819267bc4e Mon Sep 17 00:00:00 2001 From: Dzianis Sabaleuski Date: Tue, 30 Jul 2024 14:14:33 +0200 Subject: [PATCH] fix: ignore None type categories --- .../report/structure/variables/render_categorical.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ydata_profiling/report/structure/variables/render_categorical.py b/src/ydata_profiling/report/structure/variables/render_categorical.py index 86f5a262a..5cd0f8e45 100644 --- a/src/ydata_profiling/report/structure/variables/render_categorical.py +++ b/src/ydata_profiling/report/structure/variables/render_categorical.py @@ -136,6 +136,9 @@ def render_categorical_unicode( for category_alias_name, category_alias_counts in sorted( summary["category_alias_char_counts"].items(), key=lambda x: -len(x[1]) ): + if category_alias_name is None: + continue + category_alias_name = category_alias_name.replace("_", " ") cats.append( FrequencyTable(