From 4e5a380497241def5e2738289b3830a6470c6824 Mon Sep 17 00:00:00 2001 From: Julien Roussel <3178729-JulienRoussel77@users.noreply.gitlab.com> Date: Wed, 17 Apr 2024 15:27:22 +0200 Subject: [PATCH] doc examples patched --- examples/tutorials/plot_tuto_categorical.py | 2 +- qolmat/utils/data.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/tutorials/plot_tuto_categorical.py b/examples/tutorials/plot_tuto_categorical.py index 6940d50b..1584840e 100644 --- a/examples/tutorials/plot_tuto_categorical.py +++ b/examples/tutorials/plot_tuto_categorical.py @@ -21,7 +21,7 @@ # --------------------------------------------------------------- # We get the data and focus on the explanatory variables df = data.get_data("Titanic") -df = df.drop(columns=["survived"]) +df = df.drop(columns=["Survived"]) # %% # 2. Mixed type imputation methods diff --git a/qolmat/utils/data.py b/qolmat/utils/data.py index 1e5d0923..2adecf4e 100644 --- a/qolmat/utils/data.py +++ b/qolmat/utils/data.py @@ -324,7 +324,7 @@ def add_holes(df: pd.DataFrame, ratio_masked: float, mean_size: int) -> pd.DataF pd.DataFrame dataframe with missing values """ - groups = df.index.names.difference(["datetime", "date", "index"]) + groups = df.index.names.difference(["datetime", "date", "index", None]) if groups != []: generator = missing_patterns.GeometricHoleGenerator( 1, ratio_masked=ratio_masked, subset=df.columns, groups=groups