Skip to content

Commit

Permalink
fix: sort cramers heatmap columns
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbarros committed Nov 21, 2023
1 parent 35369ff commit d05cc42
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/ydata_profiling/model/pandas/correlations_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit d05cc42

Please sign in to comment.