What’s new in 2.3.0 (June 4, 2025) — pandas 3.0.0.dev0+2198.g4d67bb29ed documentation (original) (raw)
These are the changes in pandas 2.3.0. See Release notes for a full changelog including other versions of pandas.
Enhancements#
Other enhancements#
- pandas.api.interchange.from_dataframe() now uses the PyCapsule Interface if available, only falling back to the Dataframe Interchange Protocol if that fails (GH 60739)
- The semantics for the
copy
keyword in__array__
methods (i.e. called when usingnp.array()
ornp.asarray()
on pandas objects) has been updated to work correctly with NumPy >= 2 (GH 57739) - Series.str.decode() result now has StringDtype when
future.infer_string
is True (GH 60709) - to_hdf() and to_hdf() now round-trip with StringDtype (GH 60663)
- Improved
repr
of NumpyExtensionArray to account for NEP51 (GH 61085) - The Series.str.decode() has gained the argument
dtype
to control the dtype of the result (GH 60940) - The cumsum(), cummin(), and cummax() reductions are now implemented for StringDtype columns (GH 60633)
- The sum() reduction is now implemented for StringDtype columns (GH 59853)
Deprecations#
- Deprecated allowing non-
bool
values forna
in str.contains(), str.startswith(), and str.endswith() for dtypes that do not already disallow these (GH 59615) - Deprecated the
"pyarrow_numpy"
storage option for StringDtype (GH 60152)
Bug fixes#
Numeric#
- Bug in Series.mode() and DataFrame.mode() with
dropna=False
where not all dtypes would sort in the presence ofNA
values (GH 60702) - Bug in Series.round() where a
TypeError
would always raise withobject
dtype (GH 61206)
Strings#
- Bug in
Series.__pos__()
andDataFrame.__pos__()
where anException
was not raised for StringDtype withstorage="pyarrow"
(GH 60710) - Bug in Series.rank() for StringDtype with
storage="pyarrow"
that incorrectly returned integer results withmethod="average"
and raised an error if it would truncate results (GH 59768) - Bug in Series.replace() with StringDtype when replacing with a non-string value was not upcasting to
object
dtype (GH 60282) - Bug in Series.str.center() with StringDtype with
storage="pyarrow"
not matching the python behavior in corner cases with an odd number of fill characters (GH 54792) - Bug in Series.str.replace() when
n < 0
for StringDtype withstorage="pyarrow"
(GH 59628) - Bug in Series.str.slice() with negative
step
with ArrowDtype and StringDtype withstorage="pyarrow"
giving incorrect results (GH 59710)
Indexing#
- Bug in Index.get_indexer() round-tripping through string dtype when
infer_string
is enabled (GH 55834)
I/O#
- Bug in DataFrame.to_excel() which stored decimals as strings instead of numbers (GH 49598)
Other#
- Fixed usage of
inspect
when the optional dependenciespyarrow
orjinja2
are not installed (GH 60196)
Contributors#
A total of 24 people contributed patches to this release. People with a “+” by their names contributed a patch for the first time.
- ChiLin Chiu +
- Irv Lustig
- Isuru Fernando +
- Jake Thomas Trevallion +
- Joris Van den Bossche
- Kevin Amparado +
- LOCHAN PAUDEL +
- Lumberbot (aka Jack)
- Marc Mueller +
- Marco Edward Gorelli
- Matthew Roeschke
- Pandas Development Team
- Patrick Hoefler
- Richard Shadrach
- SALCAN +
- Sebastian Berg
- Simon Hawkins
- Thomas Li
- Will Ayd
- William Andrea
- William Ayd
- dependabot[bot]
- jbrockmendel
- tasfia8 +