Skip to content

ENH: Allow option to return lower triangular correlation matrix in DataFrame.corr #22840

Closed
@dsaxton

Description

@dsaxton

In a lot of situations it's useful to remove the redundant or trivial (diagonal) entries from a correlation matrix. For example, if you want to query a correlation matrix to find highly or perfectly correlated columns you have to find some way of manually ignoring the diagonal, or if you want to remove only one of two highly correlated columns, it's useful to be working only with the lower triangular form.

Therefore I think it would be very useful to add a boolean argument to DataFrame.corr which specifies if the lower triangular correlation matrix should be returned (if the upper triangular is desired the user can take the transpose) instead of the full.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AlgosNon-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diffEnhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions