Skip to content

Series.str.split with expand=True should return DataFrame #194

Closed
@Dr-Irv

Description

@Dr-Irv

Describe the bug

s = pd.Series(["abc-def", "ghi-jkl"])
s.str.split("-", expand=True)
reveal_type(s)

Above code returns DataFrame, but reveal_type returns Series[Unknown]

To Reproduce

  1. See above
  2. pyright and mypy
  3. See above.

Need to modify pandas-stubs/core/strings.pyi so that split returns DataFrame when expand=True. Create proper overload.

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