Skip to content

Commit

Permalink
list examples of operations
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Jul 28, 2023
1 parent 56d77cd commit 656950d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion doc/source/whatsnew/v2.1.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,20 @@ Deprecated silent upcasting in setitem-like Series operations
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Setitem-like operations on Series (or DataFrame columns) which silently upcast the dtype are
deprecated and show a warning.
deprecated and show a warning. Examples of affected operations are:

- ``ser.fillna('foo', inplace=True)``
- ``ser.where(ser.isna(), 'foo', inplace=True)``
- ``ser.iloc[indexer] = 'foo'``
- ``ser.loc[indexer] = 'foo'``
- ``df.iloc[indexer, 0] = 'foo'``
- ``df.loc[indexer, 'a'] = 'foo'``
- ``ser[indexer] = 'foo'``

where ``ser`` is a :class:`Series`, ``df`` is a :class:`DataFrame`, and ``indexer``
could be a slice, a mask, a single value, a list or array of values, or any other
allowed indexer.

In a future version, these will raise an error and you should cast to a common dtype first.

*Previous behavior*:
Expand Down

0 comments on commit 656950d

Please sign in to comment.