Skip to main content
`Ctrl`+`K`

# What’s new in 2.1.2 (October 26, 2023)

These are the changes in pandas 2.1.2. See Release notes for a full changelog including other versions of pandas.

## Deprecations

- Reverted deprecation of `fill_method=None` in `DataFrame.pct_change()`, `Series.pct_change()`, `DataFrameGroupBy.pct_change()`, and `SeriesGroupBy.pct_change()`; the values `'backfill'`, `'bfill'`, `'pad'`, and `'ffill'` are still deprecated (GH 53491)

## Fixed regressions

- Fixed regression in `DataFrame.join()` where result has missing values and dtype is arrow backed string (GH 55348)

- Fixed regression in `rolling()` where non-nanosecond index or `on` column would produce incorrect results (GH 55026, GH 55106, GH 55299)

- Fixed regression in `DataFrame.resample()` which was extrapolating back to `origin` when `origin` was outside its bounds (GH 55064)

- Fixed regression in `DataFrame.sort_index()` which was not sorting correctly when the index was a sliced `MultiIndex` (GH 55379)

- Fixed regression in `DataFrameGroupBy.agg()` and `SeriesGroupBy.agg()` where if the option `compute.use_numba` was set to True, groupby methods not supported by the numba engine would raise a `TypeError` (GH 55520)

- Fixed performance regression with wide DataFrames, typically involving methods where all columns were accessed individually (GH 55256, GH 55245)

- Fixed regression in `merge_asof()` raising `TypeError` for `by` with datetime and timedelta dtypes (GH 55453)

- Fixed regression in `read_parquet()` when reading a file with a string column consisting of more than 2 GB of string data and using the `"string"` dtype (GH 55606)

- Fixed regression in `DataFrame.to_sql()` not roundtripping datetime columns correctly for sqlite when using `detect_types` (GH 55554)

- Fixed regression in construction of certain DataFrame or Series subclasses (GH 54922)

## Bug fixes

- Fixed bug in `DataFrameGroupBy` reductions not preserving object dtype when `infer_string` is set (GH 55620)

- Fixed bug in `SeriesGroupBy.value_counts()` returning incorrect dtype for string columns (GH 55627)

- Fixed bug in `Categorical.equals()` if other has arrow backed string dtype (GH 55364)

- Fixed bug in `DataFrame.__setitem__()` not inferring string dtype for zero-dimensional array with `infer_string=True` (GH 55366)

- Fixed bug in `DataFrame.idxmin()` and `DataFrame.idxmax()` raising for arrow dtypes (GH 55368)

- Fixed bug in `DataFrame.interpolate()` raising incorrect error message (GH 55347)

- Fixed bug in `Index.insert()` raising when inserting `None` into `Index` with `dtype="string[pyarrow_numpy]"` (GH 55365)

- Fixed bug in `Series.all()` and `Series.any()` not treating missing values correctly for `dtype="string[pyarrow_numpy]"` (GH 55367)

- Fixed bug in `Series.floordiv()` for `ArrowDtype` (GH 55561)

- Fixed bug in `Series.mode()` not sorting values for arrow backed string dtype (GH 55621)

- Fixed bug in `Series.rank()` for `string[pyarrow_numpy]` dtype (GH 55362)

- Fixed bug in `Series.str.extractall()` for `ArrowDtype` dtype being converted to object (GH 53846)

- Fixed bug where PDEP-6 warning about setting an item of an incompatible dtype was being shown when creating a new conditional column (GH 55025)

- Silence `Period[B]` warnings introduced by GH 53446 during normal plotting activity (GH 55138)

- Fixed bug in `Series` constructor not inferring string dtype when `NA` is the first value and `infer_string` is set (:issue:` 55655`)

## Other

- Fixed non-working installation of optional dependency group `output_formatting`. Replacing underscore `_` with a dash `-` fixes broken dependency resolution. A correct way to use now is `pip install pandas[output-formatting]`.

## Contributors

A total of 20 people contributed patches to this release. People with a “+” by their names contributed a patch for the first time.

- Amanda Bizzinotto

- Artur Barseghyan +

- Hadi Abdi Khojasteh +

- Joris Van den Bossche

- Luke Manley

- Lumberbot (aka Jack)

- Marc Garcia

- Marco Edward Gorelli

- MarcoGorelli

- Mateusz Sokół

- Matthew Roeschke

- Natalia Mokeeva

- Pandas Development Team

- Patrick Hoefler

- Richard Shadrach

- Thomas Li

- Yao Xiao

- dependabot[bot]

- rohanjain101 +

- torext +