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
Copy file name to clipboardExpand all lines: doc/source/whatsnew/v2.0.0.rst
+24
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,16 @@ The ``use_nullable_dtypes`` keyword argument has been expanded to the following
49
49
* :func:`read_feather`
50
50
* :func:`to_numeric`
51
51
52
+
To simplify opting-in to nullable dtypes for these functions, a new option ``nullable_dtypes`` was added that allows setting
53
+
the keyword argument globally to ``True`` if not specified directly. The option can be enabled
54
+
through:
55
+
56
+
.. ipython:: python
57
+
58
+
pd.options.mode.nullable_dtypes =True
59
+
60
+
The option will only work for functions with the keyword ``use_nullable_dtypes``.
61
+
52
62
Additionally a new global configuration, ``mode.dtype_backend`` can now be used in conjunction with the parameter ``use_nullable_dtypes=True`` in the following functions
53
63
to select the nullable dtypes implementation.
54
64
@@ -125,6 +135,14 @@ Copy-on-Write improvements
125
135
a modification to the data happens) when constructing a Series from an existing
126
136
Series with the default of ``copy=False`` (:issue:`50471`)
127
137
138
+
- Trying to set values using chained assignment (for example, ``df["a"][1:3] = 0``)
139
+
will now always raise an exception when Copy-on-Write is enabled. In this mode,
140
+
chained assignment can never work because we are always setting into a temporary
141
+
object that is the result of an indexing operation (getitem), which under
142
+
Copy-on-Write always behaves as a copy. Thus, assigning through a chain
143
+
can never update the original Series or DataFrame. Therefore, an informative
144
+
error is raised to the user instead of silently doing nothing (:issue:`49467`)
145
+
128
146
Copy-on-Write can be enabled through
129
147
130
148
.. code-block:: python
@@ -608,6 +626,7 @@ Other API changes
608
626
methods to get a full slice (for example ``df.loc[:]`` or ``df[:]``) (:issue:`49469`)
609
627
- Disallow computing ``cumprod`` for :class:`Timedelta` object; previously this returned incorrect values (:issue:`50246`)
610
628
- Loading a JSON file with duplicate columns using ``read_json(orient='split')`` renames columns to avoid duplicates, as :func:`read_csv` and the other readers do (:issue:`50370`)
629
+
- The levels of the index of the :class:`Series` returned from ``Series.sparse.from_coo`` now always have dtype ``int32``. Previously they had dtype ``int64`` (:issue:`50926`)
611
630
- :func:`to_datetime` with ``unit`` of either "Y" or "M" will now raise if a sequence contains a non-round ``float`` value, matching the ``Timestamp`` behavior (:issue:`50301`)
612
631
-
613
632
@@ -623,6 +642,7 @@ Deprecations
623
642
- :meth:`Index.is_floating` has been deprecated. Use :func:`pandas.api.types.is_float_dtype` instead (:issue:`50042`)
624
643
- :meth:`Index.holds_integer` has been deprecated. Use :func:`pandas.api.types.infer_dtype` instead (:issue:`50243`)
625
644
- :meth:`Index.is_categorical` has been deprecated. Use :func:`pandas.api.types.is_categorical_dtype` instead (:issue:`50042`)
645
+
- :meth:`Index.is_interval` has been deprecated. Use :func:`pandas.api.types.is_intterval_dtype` instead (:issue:`50042`)
- Performance improvements to :func:`read_sas` (:issue:`47403`, :issue:`47405`, :issue:`47656`, :issue:`48502`)
907
927
- Memory improvement in :meth:`RangeIndex.sort_values` (:issue:`48801`)
908
928
- Performance improvement in :meth:`Series.to_numpy` if ``copy=True`` by avoiding copying twice (:issue:`24345`)
929
+
- Performance improvement in :meth:`Series.rename` with :class:`MultiIndex` (:issue:`21055`)
909
930
- Performance improvement in :class:`DataFrameGroupBy` and :class:`SeriesGroupBy` when ``by`` is a categorical type and ``sort=False`` (:issue:`48976`)
910
931
- Performance improvement in :class:`DataFrameGroupBy` and :class:`SeriesGroupBy` when ``by`` is a categorical type and ``observed=False`` (:issue:`49596`)
911
932
- Performance improvement in :func:`read_stata` with parameter ``index_col`` set to ``None`` (the default). Now the index will be a :class:`RangeIndex` instead of :class:`Int64Index` (:issue:`49745`)
@@ -961,6 +982,8 @@ Datetimelike
961
982
- Bug in :func:`Timestamp.utctimetuple` raising a ``TypeError`` (:issue:`32174`)
962
983
- Bug in :func:`to_datetime` was raising ``ValueError`` when parsing mixed-offset :class:`Timestamp` with ``errors='ignore'`` (:issue:`50585`)
963
984
- Bug in :func:`to_datetime` was incorrectly handling floating-point inputs within 1 ``unit`` of the overflow boundaries (:issue:`50183`)
985
+
- Bug in :func:`to_datetime` with unit of "Y" or "M" giving incorrect results, not matching pointwise :class:`Timestamp` results (:issue:`50870`)
986
+
-
964
987
965
988
Timedelta
966
989
^^^^^^^^^
@@ -1026,6 +1049,7 @@ Indexing
1026
1049
- Bug in :meth:`DataFrame.iloc` raising ``IndexError`` when indexer is a :class:`Series` with numeric extension array dtype (:issue:`49521`)
1027
1050
- Bug in :func:`~DataFrame.describe` when formatting percentiles in the resulting index showed more decimals than needed (:issue:`46362`)
1028
1051
- Bug in :meth:`DataFrame.compare` does not recognize differences when comparing ``NA`` with value in nullable dtypes (:issue:`48939`)
1052
+
- Bug in :meth:`Series.rename` with :class:`MultiIndex` losing extension array dtypes (:issue:`21055`)
1029
1053
- Bug in :meth:`DataFrame.isetitem` coercing extension array dtypes in :class:`DataFrame` to object (:issue:`49922`)
1030
1054
- Bug in :class:`BusinessHour` would cause creation of :class:`DatetimeIndex` to fail when no opening hour was included in the index (:issue:`49835`)
0 commit comments