From d05cc42d50d698c008ad093ebcd63ee4c54e20b1 Mon Sep 17 00:00:00 2001 From: alexbarros Date: Tue, 21 Nov 2023 08:40:30 -0300 Subject: [PATCH] fix: sort cramers heatmap columns --- src/ydata_profiling/model/pandas/correlations_pandas.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ydata_profiling/model/pandas/correlations_pandas.py b/src/ydata_profiling/model/pandas/correlations_pandas.py index 91bf03730..d0062f2a0 100644 --- a/src/ydata_profiling/model/pandas/correlations_pandas.py +++ b/src/ydata_profiling/model/pandas/correlations_pandas.py @@ -104,6 +104,7 @@ def pandas_cramers_compute( if len(categoricals) <= 1: return None + categoricals = sorted(categoricals) matrix = np.zeros((len(categoricals), len(categoricals))) np.fill_diagonal(matrix, 1.0) correlation_matrix = pd.DataFrame(