diff --git a/shapash/manipulation/summarize.py b/shapash/manipulation/summarize.py index db1fdc5e..f08d2354 100644 --- a/shapash/manipulation/summarize.py +++ b/shapash/manipulation/summarize.py @@ -204,7 +204,8 @@ def compute_corr(df, compute_method): from phik import phik_matrix return phik_matrix(df, verbose=False) elif compute_method == 'pearson': - return df.corr() + # remove columns with constant values that lead to NaNs + return df.loc[:, (df != df.iloc[0]).any()].corr() else: raise NotImplementedError(f'Not implemented correlation method : {compute_method}')