Skip to content

[Bug] DataFrame.set_index does not accept pd.Index anymore. #140

Closed
@alkatar21

Description

@alkatar21

Describe the bug
DataFrame.set_index does not accept pd.Index anymore.

To Reproduce

# pyright: strict, reportUnknownMemberType=false
"""Example."""
import pandas as pd

df = pd.DataFrame()
expected = df.set_index(pd.Index([])) # Argument of type "Index" cannot be assigned to parameter "keys" of type "Label | Sequence[Unknown]" in function "set_index"

grafik

Please complete the following information:

  • OS: Linux
  • OS Version: 20.04
  • python version: 3.8.10
  • version of type checker: pylance v2022.7.31 (not in v2022.7.30)
  • version of installed pandas-stubs: i belive _stub_version = Literal["1.4.3.220710"] (pylane bundled)

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions