Skip to content

DOC: clarify "inplace"-ness of DataFrame.setitem #51300

Closed
@jorisvandenbossche

Description

@jorisvandenbossche

The docstring of DataFrame.isetitem (https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.isetitem.html) has the following quote:

Unlike frame.iloc[:, i] = value, frame.isetitem(loc, value) will never try to set the values in place, but will always insert a new array.

But the docstring is actually confusing here, because it is an inplace method in the sense that it is updating the object inplace (and not returning a new object like most methods). It's only not inplace in the sense that it will not update values inplace.

Originally posted by @jorisvandenbossche in #51296 (comment)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions