Skip to content

Add axis argument to DataFrame.corr #35002

Open
@alexlenail

Description

@alexlenail

Location of the documentation

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.corr.html

Documentation problem

How should I get the correlation among the rows? I can obviously do df.T.corr() but this strikes me as a workaround rather than a nice way to do things. I wrote a df.corr(axis=1) assuming that would work. Curious what people feel is idiomatic, and would recommend some mention in the docs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions