What’s new in 3.1.0 (Month XX, 2026)#
These are the changes in pandas 3.1.0. See Release notes for a full changelog including other versions of pandas.
Enhancements#
enhancement1#
enhancement2#
Other enhancements#
DataFrameGroupBy.agg()now allows for the providedfuncto return a NumPy array (GH 63957)Added
ExtensionArray.count()(GH 64450)Display formatting for float sequences in DataFrame cells now respects the
display.precisionoption (GH 60503).Improved the string
reprofpd.core.arrays.SparseArray(GH 64547)
Notable bug fixes#
These are bug fixes that might have notable behavior changes.
notable_bug_fix1#
notable_bug_fix2#
Backwards incompatible API changes#
Increased minimum versions for dependencies#
Some minimum supported versions of dependencies were updated. If installed, we now require:
Package |
Minimum Version |
Required |
Changed |
|---|---|---|---|
X |
X |
For optional libraries the general recommendation is to use the latest version. The following table lists the lowest version per library that is currently being tested throughout the development of pandas. Optional libraries below the lowest tested version may still work, but are not considered supported.
Package |
Minimum Version |
Changed |
|---|---|---|
X |
See Dependencies and Optional dependencies for more.
Other API changes#
APIs that accept an
engine="numba"parameter withengine_kwargswill no longer pass through anopythonargument tonumba.jit. This argument has had no effect since numba 0.59.0 (GH 64483).
Deprecations#
Deprecated
DataFrameGroupBy.agg()andResampler.agg()unpacking a scalar when the providedfuncreturns a Series or array of length 1; in the future this will result in the Series or array being in the result. Users should unpack the scalar infuncitself (GH 64014)Deprecated arithmetic operations between pandas objects (
DataFrame,Series,Index, and pandas-implementedExtensionArraysubclasses) and list-likes other thanlist,np.ndarray,ExtensionArray,Index,Series,DataFrame. For e.g.tupleorrange, explicitly cast these to a supported object instead. In a future version, these will be treated as scalar-like for pointwise operation (GH 62423)Deprecated the
.nameproperty of offset objects (e.g.,Day,Hour). Use.rule_codeinstead (GH 64207)
Performance improvements#
Performance improvement in
DataFrame.__getitem__()when selecting a single column by label on aDataFramewith duplicate column names. (GH 64126).Performance improvement in
infer_freq()(GH 64463)Performance improvement in
merge()withhow="cross"(GH 38082)Performance improvement in
merge()withhow="left"(GH 64370)Performance improvement in
GroupBy.quantile()(GH 64330)Performance improvement in datetime/timedelta unit conversion (e.g.
datetime64[s]todatetime64[ns]) (GH 35025)
Bug fixes#
Fix bug in
to_datetime()that could give an unnecessaryRuntimeWarningwhen converting DataFrame containing missing values (GH 64141)
Categorical#
Datetimelike#
Bug in
Timestampconstructor,Timedeltaconstructor,to_datetime(), andto_timedelta()with non-roundfloatinput andunitfailing to raise when the value is just outside the representable bounds (GH 57366)Bug in
DatetimeArray.isin()andTimedeltaArray.isin()where mismatched resolutions could silently truncate finer-resolution values, leading to false matches (GH 64545)
Timedelta#
Timezones#
Numeric#
Fixed bug in
read_excel()where having a column with mixture of numeric and boolean values will typecast the values based on the first appearance data type since 1==True and 0==False (GH 60088)Fixed bug in
Series.clip()where passing a scalar numpy array (e.g.np.array(0)) would raise aTypeError(GH 59053)
Conversion#
Fixed
pandas.array()to preserve mask information when converting NumPy masked arrays, converting masked values to missing values (GH 63879).Fixed bug in
DataFrame.from_records()whereexcludewas ignored whendatawas an iterator andnrows=0(GH 63774)
Strings#
Interval#
Indexing#
Missing#
MultiIndex#
I/O#
Fixed bug in
read_excel()where usage ofskiprowscould lead to an infinite loop (GH 64027)Fixed
read_json()withlines=Trueandchunksizeto respectnrowswhen the requested row count is not a multiple of the chunk size (GH 64025)Fixed
read_json()withlines=Trueandnrows=0to return an empty DataFrame (GH 64025)
Period#
Plotting#
Groupby/resample/rolling#
Bug in
DataFrameGroupBy.agg()when there are no groups, multiple keys, andgroup_keys=False(GH 51445)Bug in
DataFrameGroupBy.agg()would operate on the group as a whole whenargsorkwargsare supplied for the providedfunc; now this method only operates on each Series of the group (GH 39169)
Reshaping#
In
pivot_table(), whenvaluesis empty, the aggregation will be computed on a Series of all NA values (GH 46475)
Sparse#
Bug in indexing a
SparseArraywith an out-of-bounds integer with the value of the length of the array returning the fill value instead of raising anIndexError(GH 64183).
ExtensionArray#
Fixed bug in
Series.apply()andSeries.map()where nullable integer dtypes were converted to float, causing precision loss for large integers; now the nullable dtype will be preserved (GH 63903).