Skip to content

TYP: annotate index/columns as Index #51819

Closed
@jbrockmendel

Description

@jbrockmendel

Series defined index and DataFrame defines index and columns as AxisProperty objects, which are property-like. These are not annotated as giving Index objects when accessed. I found in #51813 then when just adding index: Index to a mixin it caused 400ish mypy complaints elsewhere. The same thing happens if i add index: Index in NDFrame.

So it'd be nice if we can find a way to type AxisProperty.__get__ as returning an Index.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugNeeds TriageIssue that has not been reviewed by a pandas team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions