From 35369ffdd7ae05b38399d44280b2445c83669dd8 Mon Sep 17 00:00:00 2001 From: alexbarros Date: Tue, 21 Nov 2023 08:36:27 -0300 Subject: [PATCH 1/4] fix: corr heatmap using deterministic col order --- src/ydata_profiling/model/pandas/correlations_pandas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ydata_profiling/model/pandas/correlations_pandas.py b/src/ydata_profiling/model/pandas/correlations_pandas.py index 39f8cf71e..91bf03730 100644 --- a/src/ydata_profiling/model/pandas/correlations_pandas.py +++ b/src/ydata_profiling/model/pandas/correlations_pandas.py @@ -183,7 +183,7 @@ def pandas_auto_compute( df_discretized = Discretizer( DiscretizationType.UNIFORM, n_bins=config.correlations["auto"].n_bins ).discretize_dataframe(df) - columns_tested = numerical_columns + categorical_columns + columns_tested = sorted(numerical_columns) + sorted(categorical_columns) correlation_matrix = pd.DataFrame( np.ones((len(columns_tested), len(columns_tested))), index=columns_tested, From d05cc42d50d698c008ad093ebcd63ee4c54e20b1 Mon Sep 17 00:00:00 2001 From: alexbarros Date: Tue, 21 Nov 2023 08:40:30 -0300 Subject: [PATCH 2/4] 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( From f897012fe8754ce26c7b626408c81acc6f1afd28 Mon Sep 17 00:00:00 2001 From: alexbarros Date: Tue, 21 Nov 2023 08:46:38 -0300 Subject: [PATCH 3/4] fix: avoid errors from missidentified types --- src/ydata_profiling/model/pandas/correlations_pandas.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ydata_profiling/model/pandas/correlations_pandas.py b/src/ydata_profiling/model/pandas/correlations_pandas.py index d0062f2a0..8dae428f0 100644 --- a/src/ydata_profiling/model/pandas/correlations_pandas.py +++ b/src/ydata_profiling/model/pandas/correlations_pandas.py @@ -184,7 +184,8 @@ def pandas_auto_compute( df_discretized = Discretizer( DiscretizationType.UNIFORM, n_bins=config.correlations["auto"].n_bins ).discretize_dataframe(df) - columns_tested = sorted(numerical_columns) + sorted(categorical_columns) + columns_tested = sorted(numerical_columns + categorical_columns) + correlation_matrix = pd.DataFrame( np.ones((len(columns_tested), len(columns_tested))), index=columns_tested, From 235064e80590636c3a50b181e7ddad94622bd6e5 Mon Sep 17 00:00:00 2001 From: alexbarros Date: Tue, 21 Nov 2023 12:15:05 -0300 Subject: [PATCH 4/4] fix: config error caused by increased version --- mkdocs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index 4d2ad8320..cab5f2351 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -134,7 +134,6 @@ plugins: lang: en - autorefs - mkdocstrings: - custom_templates: templates default_handler: python handlers: python: