opened
dsaxton
username_0
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 just takes the transpose) instead of the full.
ENH:  Allow option to return lower triangular correlation matrix in DataFrame.corr
issue
created
mroeschke
username_1
Copying from the https://github.com/pandas-dev/pandas/pull/22842#issuecomment-424844444

1. If we were to include a tri argument, I would prefer a tri=None(default)/'upper'/'lower' instead of tri=True/False for just the lower triangular so users can have the option of the upper triangular.

2. In your implementation, it appears fill value would be NaN as opposed to numpy (triu/trul) which the fill value is 0. I am not sure what the preferred fill value should be, but in general we try to stay consistent with numpy conventions.
comment
created
aliobeid
username_2
correlation a commutative operation i.e. corr(a,b)=corr(b,a). Calculating anything other that a triangle does not make any sense
comment
created
aliobeid
username_2
Pearson correlation is commutative i.e. corr(X,Y) = corr(Y,X). It makes no sense to calculate anything other than one of the triangles
comment
closed
jreback
username_3
issue