CorrDocs
Calculates the Pearson pairwise correlation between values in the specified columns.
This function does not compute the correlation immediately. Instead, it defines the primary set of columns and returns a Corr instance that allows configuring how the correlation should be computed.
The function is available for numeric- and Boolean columns. Boolean values are converted into 1 for true and 0 for false. All other columns are ignored. If a ColumnGroup instance is passed as the target column for correlation, it will be unpacked into suitable nested columns.
The Corr object provides two methods to perform correlation calculations:
with— computes correlations between the initially selected columns and a second set of columns.withItself— computes pairwise correlations within the initially selected columns.
Each method returns a square or rectangular correlation matrix represented by a DataFrame, where rows and columns correspond to the selected column sets, and each cell contains the Pearson correlation coefficient between the corresponding pair of columns.
To compute correlations between all suitable columns in the DataFrame, use DataFrame.corr().
Check out Grammar.
This can include column groups and nested columns.
See also: Selecting Columns.
For more information, see: See corr on the documentation website.
Types
Selecting columns for various DataFrame operations can be done in the following ways: