What’s new in 3.1.2 (November 30, 2026)#
These are the changes in pandas 3.1.2. See Release notes for a full changelog including other versions of pandas.
Fixed regressions#
Fixed a regression in
arrays.SparseArrayarithmetic with atimedelta64scalar in a unit pandas does not support, such asnp.timedelta64(1, "D"), raisingTypeError(GH 71872)Fixed a regression in
read_csv()returning flat columns instead of aMultiIndexfor tuplenameson files of 5 MB or more (GH 71882)Fixed a regression in
read_csv()withengine="pyarrow"andparse_datesconverting a non-dateindex_col(e.g. integers) to strings (GH 71873)Fixed a regression in
read_csv(),read_json()andread_xml()raising _”ValueError: I/O operation on closed file”_ when reading from a stream that closes itself once exhausted, such as arequestsResponse.rawobject (GH 71983)Fixed a regression in
testing.assert_frame_equal(),testing.assert_series_equal()and the other assertion functions, where the failure message rounded float values todisplay.precision, so differing values could look identical (GH 71509)Fixed a regression in
CategoricalIndex.__contains__()returning wrong results when the categories are constructed from arange; values present in the index could be reported missing and unused categories reported as present (GH 72247)Fixed a regression in
DataFrame.ewm()andSeries.ewm()withadjust=Falseandignore_na=Falsereturning incorrect results for data containingNaNwhencom=1(equivalentlyspan=3,alpha=0.5, orhalflife=1) (GH 31178)Fixed a regression in
DataFrame.plot()andSeries.plot()raisingConversionErrorwhen plotting timezone-aware datetime data containing missing values (GH 71879)Fixed a regression in
Series.sort_values()convertingobjectdtype holding strings tostrdtype when the values were not already sorted, and raisingUnicodeEncodeErrorfor strings containing lone surrogates; sorting now preservesobjectdtype as in pandas 2.x (GH 71978)Fixed a regression in
Timestamp.strftime()raisingAttributeErrorinstead ofTypeErrorwhenformatis not a string (GH 71914)Fixed a regression in
fillna()onarrays.DatetimeArray,arrays.TimedeltaArrayandarrays.PeriodArraynot raising on an invalid fill value when the array has no missing values (GH 36466)
Bug fixes#
Fixed
SparseArray.from_indices()raising ondatetime64ortimedelta64data in a unit pandas does not support, and silently accepting unsorted, duplicate or negativeindiceswithkind="block"(GH 71872)
Contributors#
A total of 7 people contributed patches to this release. People with a “+” by their names contributed a patch for the first time.
Aarya +
Ishan Kumar +
Joris Van den Bossche
Mutasim ur Rehman +
a12san +
jbrockmendel
pandas Development Team