Skip to content

Commit 9acacce

Browse files
committed
docs
1 parent c19087f commit 9acacce

File tree

1 file changed

+49
-4
lines changed

1 file changed

+49
-4
lines changed

doc/source/whatsnew/v0.21.0.txt

+49-4
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,58 @@ Backwards incompatible API changes
5959
Dtype Conversions
6060
^^^^^^^^^^^^^^^^^
6161

62-
Example about setitem / where with bools.
62+
- Previously assignments, ``.where()`` and ``.fillna()`` with a ``bool`` assignment, would coerce to
63+
same type (e.g. int / float), or raise for datetimelikes. These will now preseve the bools with ``object`` dtypes. (:issue:`16821`).
6364

65+
.. ipython:: python
6466

67+
s = Series([1, 2, 3])
6568

66-
- Inconsistent behavior in ``.where()`` with datetimelikes which would raise rather than coerce to ``object`` (:issue:`16402`)
67-
- Bug in assignment against datetime-like data with ``int`` may incorrectly convert to datetime-like (:issue:`14145`)
68-
- Bug in assignment against ``int64`` data with ``np.ndarray`` with ``float64`` dtype may keep ``int64`` dtype (:issue:`14001`)
69+
.. code-block:: python
70+
71+
In [5]: s[1] = True
72+
73+
In [6]: s
74+
Out[6]:
75+
0 1
76+
1 1
77+
2 3
78+
dtype: int64
79+
80+
New Behavior
81+
82+
.. ipython:: python
83+
84+
s[1] = True
85+
s
86+
87+
- Previously as assignment to a datetimelike with a non-datetimelike would corece (:issue:`14145`).
88+
89+
.. ipython:: python
90+
91+
s = pd.Series([pd.Timestamp('2011-01-01'), pd.Timestamp('2012-01-01')])
92+
93+
.. code-block:: python
94+
95+
In [1]: s[1] = 1
96+
97+
In [2]: s
98+
Out[2]:
99+
0 2011-01-01 00:00:00.000000000
100+
1 1970-01-01 00:00:00.000000001
101+
dtype: datetime64[ns]
102+
103+
These now coerce to ``object`` dtype.
104+
105+
.. ipython:: python
106+
107+
s[1] = 1
108+
s
109+
110+
- Additional bug fixes w.r.t. dtype conversions.
111+
112+
- Inconsistent behavior in ``.where()`` with datetimelikes which would raise rather than coerce to ``object`` (:issue:`16402`)
113+
- Bug in assignment against ``int64`` data with ``np.ndarray`` with ``float64`` dtype may keep ``int64`` dtype (:issue:`14001`)
69114

70115
.. _whatsnew_0210.api:
71116

0 commit comments

Comments
 (0)