Skip to content

BUG/TYP: 1.3.0 index.values returns ExtensionArray | ndarray instead of ndarray #42002

Closed
@twoertwein

Description

@twoertwein
  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • (optional) I have confirmed this bug exists on the master branch of pandas.


Probably an intended change, but I didn't find anything related to it in the whatsnew.

import pandas as pd

df = pd.DataFrame({"a": [1]})

reveal_type(df.values)
reveal_type(df.index.values)

pyright with 1.2.4

info: Type of "df.values" is "ndarray"
info: Type of "df.index.values" is "ndarray"

pyright with 1.3.0.rc1

info: Type of "df.values" is "ndarray"
info: Type of "df.index.values" is "ExtensionArray | ndarray"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Closing CandidateMay be closeable, needs more eyeballsTypingtype annotations, mypy/pyright type checking

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions