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
Previously, declaring or converting to :class:`StringDtype` was in general only possible if the data was already only ``str`` or nan-like (:issue:`31204`).
22
+
:class:`StringDtype` now works in all situations where ``astype(str)`` or ``dtype=str`` work:
23
+
24
+
For example, the below now works:
25
+
26
+
.. ipython:: python
27
+
28
+
ser = pd.Series([1, "abc", np.nan], dtype="string")
- :class:`Series.str` now has a `fullmatch` method that matches a regular expression against the entire string in each row of the series, similar to `re.fullmatch` (:issue:`32806`).
210
228
- :meth:`DataFrame.sample` will now also allow array-like and BitGenerator objects to be passed to ``random_state`` as seeds (:issue:`32503`)
211
229
- :meth:`MultiIndex.union` will now raise `RuntimeWarning` if the object inside are unsortable, pass `sort=False` to suppress this warning (:issue:`33015`)
212
-
- :class:`Series.dt` and :class:`DatatimeIndex` now have an `isocalendar` method that returns a :class:`DataFrame` with year, week, and day calculated according to the ISO 8601 calendar (:issue:`33206`).
230
+
- :class:`Series.dt` and :class:`DatatimeIndex` now have an `isocalendar` method that returns a :class:`DataFrame` with year, week, and day calculated according to the ISO 8601 calendar (:issue:`33206`, :issue:`34392`).
213
231
- The :meth:`DataFrame.to_feather` method now supports additional keyword
214
232
arguments (e.g. to set the compression) that are added in pyarrow 0.17
215
233
(:issue:`33422`).
@@ -565,6 +583,53 @@ Assignment to multiple columns of a :class:`DataFrame` when some of the columns
Using :meth:`DataFrame.groupby` with ``as_index=True`` and the aggregation ``nunique`` would include the grouping column(s) in the columns of the result. Now the grouping column(s) only appear in the index, consistent with other reductions. (:issue:`32579`)
Using :meth:`DataFrame.groupby` with ``as_index=False`` and the function ``idxmax``, ``idxmin``, ``mad``, ``nunique``, ``sem``, ``skew``, or ``std`` would modify the grouping column. Now the grouping column remains unchanged, consistent with other reductions. (:issue:`21090`, :issue:`10355`)
616
+
617
+
*Previous behavior*:
618
+
619
+
.. code-block:: ipython
620
+
621
+
In [3]: df.groupby("a", as_index=False).nunique()
622
+
Out[4]:
623
+
a b
624
+
0 1 1
625
+
1 1 2
626
+
627
+
*New behavior*:
628
+
629
+
.. ipython:: python
630
+
631
+
df.groupby("a", as_index=False).nunique()
632
+
568
633
.. _whatsnew_110.deprecations:
569
634
570
635
Deprecations
@@ -590,6 +655,9 @@ Deprecations
590
655
591
656
- :func:`pandas.api.types.is_categorical` is deprecated and will be removed in a future version; use `:func:pandas.api.types.is_categorical_dtype` instead (:issue:`33385`)
592
657
- :meth:`Index.get_value` is deprecated and will be removed in a future version (:issue:`19728`)
658
+
- :meth:`Series.dt.week` and `Series.dt.weekofyear` are deprecated and will be removed in a future version, use :meth:`Series.dt.isocalendar().week` instead (:issue:`33595`)
659
+
- :meth:`DatetimeIndex.week` and `DatetimeIndex.weekofyear` are deprecated and will be removed in a future version, use :meth:`DatetimeIndex.isocalendar().week` instead (:issue:`33595`)
660
+
- :meth:`DatetimeArray.week` and `DatetimeArray.weekofyear` are deprecated and will be removed in a future version, use :meth:`DatetimeArray.isocalendar().week` instead (:issue:`33595`)
593
661
- :meth:`DateOffset.__call__` is deprecated and will be removed in a future version, use ``offset + other`` instead (:issue:`34171`)
594
662
- Indexing an :class:`Index` object with a float key is deprecated, and will
595
663
raise an ``IndexError`` in the future. You can manually convert to an integer key
@@ -621,6 +689,7 @@ Performance improvements
621
689
- Performance improvement in reductions (sum, prod, min, max) for nullable (integer and boolean) dtypes (:issue:`30982`, :issue:`33261`, :issue:`33442`).
622
690
- Performance improvement in arithmetic operations between two :class:`DataFrame` objects (:issue:`32779`)
623
691
- Performance improvement in :class:`pandas.core.groupby.RollingGroupby` (:issue:`34052`)
692
+
- Performance improvement in arithmetic operations (sub, add, mul, div) for MultiIndex (:issue:`34297`)
- Bug in :meth:`~DataFrame.read_feather` was raising an `ArrowIOError` when reading an s3 or http file path (:issue:`29055`)
803
872
- Bug in :meth:`read_parquet` was raising a ``FileNotFoundError`` when passed an s3 directory path. (:issue:`26388`)
804
873
- Bug in :meth:`~DataFrame.to_parquet` was throwing an ``AttributeError`` when writing a partitioned parquet file to s3 (:issue:`27596`)
874
+
- Bug in :meth:`~DataFrame.to_excel` could not handle the column name `render` and was raising an ``KeyError`` (:issue:`34331`)
805
875
- Bug in :meth:`~DataFrame.to_json` with 'table' orient was writting wrong index field name for MultiIndex Dataframe with a single level. (:issue:`29928`)
806
876
807
877
Plotting
@@ -833,7 +903,10 @@ Groupby/resample/rolling
833
903
- Bug in :meth:`Series.groupby` would raise ``ValueError`` when grouping by :class:`PeriodIndex` level (:issue:`34010`)
834
904
- Bug in :meth:`GroupBy.agg`, :meth:`GroupBy.transform`, and :meth:`GroupBy.resample` where subclasses are not preserved (:issue:`28330`)
835
905
- Bug in :meth:`GroupBy.rolling.apply` ignores args and kwargs parameters (:issue:`33433`)
836
-
- Bug in :meth:`DataFrameGroupby.std` and :meth:`DataFrameGroupby.sem` would modify grouped-by columns when ``as_index=False`` (:issue:`10355`)
906
+
- Bug in :meth:`core.groupby.DataFrameGroupBy.apply` where the output index shape for functions returning a DataFrame which is equally indexed
907
+
to the input DataFrame is inconsistent. An internal heuristic to detect index mutation would behave differently for equal but not identical
908
+
indices. In particular, the result index shape might change if a copy of the input would be returned.
909
+
The behaviour now is consistent, independent of internal heuristics. (:issue:`31612`, :issue:`14927`, :issue:`13056`)
837
910
838
911
Reshaping
839
912
^^^^^^^^^
@@ -863,6 +936,7 @@ Reshaping
863
936
- Bug in :func:`cut` raised an error when non-unique labels (:issue:`33141`)
864
937
- Bug in :meth:`DataFrame.replace` casts columns to ``object`` dtype if items in ``to_replace`` not in values (:issue:`32988`)
865
938
- Ensure only named functions can be used in :func:`eval()` (:issue:`32460`)
939
+
- Fixed bug in :func:`melt` where melting MultiIndex columns with ``col_level`` > 0 would raise a ``KeyError`` on ``id_vars`` (:issue:`34129`)
0 commit comments