Skip to content

Series.loc, Series.iloc, DataFrame.loc and DataFrame.iloc not accepting singular slice arguments for __setitem__() (and possibly __getitem()) #572

Closed
@randolf-scholz

Description

@randolf-scholz

Describe the bug

To perform complicated in-place operations, one can do df.loc[:] = ..., to simply assign the updated array. This is currently unsupported by pandas-stubs.

To Reproduce

from pandas import DataFrame, Series

foo = Series([1, 2, 3])
foo.loc[:] = 1 + foo  # [call-overload]

bar = DataFrame([1, 2, 3])
bar.loc[:] = 1 + bar  # [call-overload]

Please complete the following information:

  • pandas 1.5.3
  • pandas-stubs 1.5.3.230304

Metadata

Metadata

Assignees

No one assigned

    Labels

    IndexingRelated to indexing on series/frames, not to indexes themselves

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions