Skip to content

adding covariance to dataframe #194

Closed
@ghost

Description

here is a sample implementation for dataframe.

def cov(self):
    """
    Compute pairwise covariance of columns

    Returns
    -------
    y : DataFrame
    """

    cols = self.columns
    std = np.diag(self.std())
    corr = self.corr()
    result = np.dot(np.dot(std, corr), std)
    return self._constructor(result , index=cols, columns=cols)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions