You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- The semantics for the ``copy`` keyword in ``__array__`` methods (i.e. called
36
24
when using ``np.array()`` or ``np.asarray()`` on pandas objects) has been
37
-
updated to raise FutureWarning with NumPy >= 2 (:issue:`60340`)
38
-
- :meth:`Series.str.decode` result now has ``StringDtype`` when ``future.infer_string`` is True (:issue:`60709`)
39
-
- :meth:`pandas.api.interchange.from_dataframe` now uses the `PyCapsule Interface <https://arrow.apache.org/docs/format/CDataInterface/PyCapsuleInterface.html>`_ if available, only falling back to the Dataframe Interchange Protocol if that fails (:issue:`60739`)
40
-
- :meth:`~Series.to_hdf` and :meth:`~DataFrame.to_hdf` now round-trip with ``StringDtype`` (:issue:`60663`)
25
+
updated to work correctly with NumPy >= 2 (:issue:`57739`)
26
+
- :meth:`Series.str.decode` result now has :class:`StringDtype` when ``future.infer_string`` is True (:issue:`60709`)
27
+
- :meth:`~Series.to_hdf` and :meth:`~DataFrame.to_hdf` now round-trip with :class:`StringDtype` (:issue:`60663`)
41
28
- Improved ``repr`` of :class:`.NumpyExtensionArray` to account for NEP51 (:issue:`61085`)
42
29
- The :meth:`Series.str.decode` has gained the argument ``dtype`` to control the dtype of the result (:issue:`60940`)
43
-
- The :meth:`~Series.cumsum`, :meth:`~Series.cummin`, and :meth:`~Series.cummax` reductions are now implemented for ``StringDtype`` columns (:issue:`60633`)
44
-
- The :meth:`~Series.sum` reduction is now implemented for ``StringDtype`` columns (:issue:`59853`)
30
+
- The :meth:`~Series.cumsum`, :meth:`~Series.cummin`, and :meth:`~Series.cummax` reductions are now implemented for :class:`StringDtype` columns (:issue:`60633`)
31
+
- The :meth:`~Series.sum` reduction is now implemented for :class:`StringDtype` columns (:issue:`59853`)
@@ -56,11 +43,26 @@ These are bug fixes that might have notable behavior changes.
56
43
notable_bug_fix1
57
44
^^^^^^^^^^^^^^^^
58
45
46
+
In previous versions, comparing :class:`Series` of different string dtypes (e.g. ``pd.StringDtype("pyarrow", na_value=pd.NA)`` against ``pd.StringDtype("python", na_value=np.nan)``) would result in inconsistent resulting dtype or incorrectly raise. pandas will now use the hierarchy
59
47
60
48
Increased minimum version for Python
61
49
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62
50
63
-
pandas 2.3.0 supports Python 3.10 and higher.
51
+
in determining the result dtype when there are different string dtypes compared. Some examples:
52
+
53
+
- When ``pd.StringDtype("pyarrow", na_value=pd.NA)`` is compared against any other string dtype, the result will always be ``boolean[pyarrow]``.
54
+
- When ``pd.StringDtype("python", na_value=pd.NA)`` is compared against ``pd.StringDtype("pyarrow", na_value=np.nan)``, the result will be ``boolean``, the NumPy-backed nullable extension array.
55
+
- When ``pd.StringDtype("python", na_value=pd.NA)`` is compared against ``pd.StringDtype("python", na_value=np.nan)``, the result will be ``boolean``, the NumPy-backed nullable extension array.
56
+
57
+
.. _whatsnew_230.api_changes:
58
+
59
+
API changes
60
+
~~~~~~~~~~~
61
+
62
+
- When enabling the ``future.infer_string`` option, :class:`Index` set operations (like
63
+
union or intersection) will now ignore the dtype of an empty :class:`RangeIndex` or
64
+
empty :class:`Index` with ``object`` dtype when determining the dtype of the resulting
- Deprecated the ``"pyarrow_numpy"`` storage option for :class:`StringDtype` (:issue:`60152`)
72
74
- The deprecation of setting the argument ``include_groups`` to ``True`` in :meth:`DataFrameGroupBy.apply` has been promoted from a ``DeprecationWarning`` to ``FutureWarning``; only ``False`` will be allowed (:issue:`7155`)
- Enabled :class:`Series.mode` and :class:`DataFrame.mode` with ``dropna=False`` to sort the result for all dtypes in the presence of NA values; previously only certain dtypes would sort (:issue:`60702`)
111
-
- Bug in :meth:`Series.round` on object columns no longer raises ``TypeError``
112
-
-
113
-
114
-
Conversion
115
-
^^^^^^^^^^
116
-
-
117
-
-
84
+
- Bug in :meth:`Series.mode` and :meth:`DataFrame.mode` with ``dropna=False`` where not all dtypes would sort in the presence of ``NA`` values (:issue:`60702`)
85
+
- Bug in :meth:`Series.round` where a ``TypeError`` would always raise with ``object`` dtype (:issue:`61206`)
118
86
119
87
Strings
120
88
^^^^^^^
121
-
- Bug in :meth:`Series.__pos__` and :meth:`DataFrame.__pos__` did not raise for :class:`StringDtype` with ``storage="pyarrow"`` (:issue:`60710`)
122
-
- Bug in :meth:`Series.rank` for :class:`StringDtype` with ``storage="pyarrow"`` incorrectly returning integer results in case of ``method="average"`` and raising an error if it would truncate results (:issue:`59768`)
89
+
- Bug in :meth:`.DataFrameGroupBy.min`, :meth:`.DataFrameGroupBy.max`, :meth:`.Resampler.min`, :meth:`.Resampler.max` where all NA values of string dtype would return float instead of string dtype (:issue:`60810`)
90
+
- Bug in :meth:`DataFrame.sum` with ``axis=1``, :meth:`.DataFrameGroupBy.sum` or :meth:`.SeriesGroupBy.sum` with ``skipna=True``, and :meth:`.Resampler.sum` with all NA values of :class:`StringDtype` resulted in ``0`` instead of the empty string ``""`` (:issue:`60229`)
91
+
- Bug in :meth:`Series.__pos__` and :meth:`DataFrame.__pos__` where an ``Exception`` was not raised for :class:`StringDtype` with ``storage="pyarrow"`` (:issue:`60710`)
92
+
- Bug in :meth:`Series.rank` for :class:`StringDtype` with ``storage="pyarrow"`` that incorrectly returned integer results with ``method="average"`` and raised an error if it would truncate results (:issue:`59768`)
123
93
- Bug in :meth:`Series.replace` with :class:`StringDtype` when replacing with a non-string value was not upcasting to ``object`` dtype (:issue:`60282`)
94
+
- Bug in :meth:`Series.str.center` with :class:`StringDtype` with ``storage="pyarrow"`` not matching the python behavior in corner cases with an odd number of fill characters (:issue:`54792`)
124
95
- Bug in :meth:`Series.str.replace` when ``n < 0`` for :class:`StringDtype` with ``storage="pyarrow"`` (:issue:`59628`)
125
-
- Bug in ``ser.str.slice`` with negative ``step`` with :class:`ArrowDtype` and :class:`StringDtype` with ``storage="pyarrow"`` giving incorrect results (:issue:`59710`)
126
-
- Bug in the ``center`` method on :class:`Series` and :class:`Index` object ``str`` accessors with pyarrow-backed dtype not matching the python behavior in corner cases with an odd number of fill characters (:issue:`54792`)
127
-
128
-
Interval
129
-
^^^^^^^^
130
-
-
131
-
-
96
+
- Bug in :meth:`Series.str.slice` with negative ``step`` with :class:`ArrowDtype` and :class:`StringDtype` with ``storage="pyarrow"`` giving incorrect results (:issue:`59710`)
132
97
133
98
Indexing
134
99
^^^^^^^^
135
-
- Fixed bug in :meth:`Index.get_indexer` round-tripping through string dtype when ``infer_string`` is enabled (:issue:`55834`)
136
-
-
137
-
138
-
Missing
139
-
^^^^^^^
140
-
-
141
-
-
142
-
143
-
MultiIndex
144
-
^^^^^^^^^^
145
-
-
146
-
-
100
+
- Bug in :meth:`Index.get_indexer` round-tripping through string dtype when ``infer_string`` is enabled (:issue:`55834`)
147
101
148
102
I/O
149
103
^^^
150
-
-
151
-
-
152
-
153
-
Period
154
-
^^^^^^
155
-
-
156
-
-
157
-
158
-
Plotting
159
-
^^^^^^^^
160
-
-
161
-
-
162
-
163
-
Groupby/resample/rolling
164
-
^^^^^^^^^^^^^^^^^^^^^^^^
165
-
-
166
-
-
167
-
168
-
Reshaping
169
-
^^^^^^^^^
170
-
-
171
-
-
172
-
173
-
Sparse
174
-
^^^^^^
175
-
-
176
-
-
177
-
178
-
ExtensionArray
179
-
^^^^^^^^^^^^^^
180
-
-
181
-
-
182
-
183
-
Styler
184
-
^^^^^^
185
-
-
186
-
-
104
+
- Bug in :meth:`DataFrame.to_excel` which stored decimals as strings instead of numbers (:issue:`49598`)
0 commit comments