What’s new in 3.2.0 (Month XX, 2027)#
These are the changes in pandas 3.2.0. See Release notes for a full changelog including other versions of pandas.
Enhancements#
enhancement1#
enhancement2#
Other enhancements#
Series,DataFrame,Index, andExtensionArraynow support theminimummaximumufunc reduction backingnp.minmax(NumPy 2.6+), returning the same results asnp.minimum.reduceandnp.maximum.reduce(GH 71380)numpy.delete()on anExtensionArray, andnumpy.concatenate()onExtensionArrayobjects of the same dtype, now return anExtensionArrayof that dtype instead of a NumPy array (GH 26380)read_csv()andread_table()withsep=Nonenow sniff the separator with the C engine instead of falling back to the slower python engine (GH 9645)read_csv()with the"c"and"python"engines now accepts aDatetimeTZDtypeindtype(GH 24542)DataFrameGroupBy.plot()now titles each group’s figure with its group key, unlesstitleoraxis passed (GH 12452)DataFrameGroupBy.rank()andSeriesGroupBy.rank()now accept anumeric_onlyargument, matchingDataFrame.rank()(GH 44438)DataFrame.plot.area()andSeries.plot.area()now accept keyword arguments that only the lines or only the filled areas support, such ashatch,edgecolorandmarker, instead of raisingAttributeError;hatchalso accepts a list with one hatch per column (GH 12354)DataFrame.to_csv()and other writers now accept anos.PathLikesuch aspathlib.Pathfor thearchive_nameentry of a zip or tarcompressiondict (GH 31934)DataFrame.to_json(),Series.to_json()andDataFrame.to_xml()now warn when a compression method is requested but no path is given, since the returned string is not compressed, and raise for an unrecognizedcompressionas they do with a path (GH 32326)Series.astype()andarray()withdtype="boolean"now convert values the same way asastype(bool)instead of raising for values other than booleans, 0 and 1 (e.g."False"becomesTrue), with missing values becomingNA(GH 37614, GH 40566)DatetimeIndex.floor(),DatetimeIndex.ceil(),Series.dt.floor(),Series.dt.ceil(),Timestamp.floor(), andTimestamp.ceil()now accept a single step of a date-anchored frequency such as"MS","QE","W-SUN", or"B"(GH 15303)Series.groupby()now acceptsas_index=False, returning aggregation results as aDataFramewith the group labels as columns (GH 36507)Added
api.extensions.Accessorto the public API, for adding or overriding an accessor on a single class such as aDataFramesubclass (GH 40103)Added
Categorical.to_dense()andSeries.cat.to_dense()to get the values with the dtype of the categories, including extension dtypes (GH 26410)Added
DatetimeIndex.set_freq()andTimedeltaIndex.set_freq(), which return a new index with the givenfreqinstead of modifying it in place (GH 61094)Added
Series.dt.shift()to shift datetime, timedelta, and period values by a number of frequency increments, likeDatetimeIndex.shift()(GH 31705)Display formatting for complex numbers in
objectdtype and forintervaldtype values with float endpoints now respects thedisplay.precisionanddisplay.float_formatoptions (GH 25920).In Jupyter notebooks, a
Seriesis now displayed as an HTML table, with its name and dtype shown below the table as in its text repr (GH 5563)Printing a
Stylernow shows the underlying data instead of the object’s address, so the table also appears in notebooks exported to PDF withnbconvert(GH 55908)The
ExtensionArraybase tests inpandas.tests.extension.basenow issue aerrors.PerformanceWarningwhen the array uses the default, possibly slow, implementation ofunique,factorize,argsort,argmin,argmax, orsearchsorted(GH 24433)
Notable bug fixes#
These are bug fixes that might have notable behavior changes.
DataFrame.rank() ranks each column in its own dtype#
DataFrame.rank() with axis=0 cast the whole frame to one common dtype
before ranking, so its result could differ from Series.rank() on the same
column. Each column is now ranked on its own and the two agree. Besides
retaining extension dtypes, this changes the ranks themselves for an ordered
Categorical whose categories are not in the natural order of their
values, and for integers above 2**53 in a frame whose common dtype was
float64 (GH 52829, GH 15420).
In [1]: cat = pd.Categorical(
...: ["b", "a", "c", "a"], categories=["c", "b", "a"], ordered=True
...: )
In [2]: df = pd.DataFrame({"a": cat})
Previous behavior:
In [3]: df.rank()["a"].tolist()
Out[3]: [3.0, 1.5, 4.0, 1.5]
New behavior:
In [3]: df.rank()["a"].tolist()
Out[3]: [2.0, 3.5, 1.0, 3.5]
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 |
|---|---|---|
tabulate |
0.10.0 |
X |
See Dependencies and Optional dependencies for more.
Other API changes#
Stylernow displays missing float values asNaNrather thannanby default, matchingDataFrame(GH 12710)ExtensionArraynow implements__array_function__. Code expectingnumpy.concatenate()ornumpy.delete()to return a NumPy array forExtensionArrayinput, including_concat_same_typeanddeleteimplementations inExtensionArraysubclasses, may need updating, as may code mixing anExtensionArraywith another library’s__array_function__arrays (GH 26380)Indexnow displays missing float values asNaNrather thannanin its repr, matchingSeriesandDataFrame(GH 64733)Timedeltaandto_timedelta()now raiseValueErrorfor a string with a comma between digits outside the seconds field, such as"1,5 days"or"1,234 days", instead of ignoring the comma (GH 71877)ExtensionArray._concat_same_type()now has anaxiskeyword (default0); pandas only passes it for dtypes that support 2D, so existing implementations without it keep working (GH 47514)Styler.to_excel()now omits the rows, columns, index and header levels, and names hidden withStyler.hide(), matching the otherStyleroutput methods; hiding the whole index withMultiIndexcolumns now raisesNotImplementedError, asindex=Falsedoes (GH 42276)DataFrame.copy()andSeries.copy()withdeep=True(the default), andArrowExtensionArray.copy(), now copy pyarrow-backed data instead of sharing its memory, so a copy no longer keeps the original’s memory alive (GH 61930)DataFrame.query()now raises aValueErrorwhen the expression does not evaluate to a boolean array, instead of silently using the result as row labels; useDataFrame.locfor label selection (GH 8560)rangevalues are now displayed asrange(0, 3)rather than as the tuple(0, 1, 2), matchingStyler(GH 44799)
Deprecations#
deprecation1#
deprecation2#
Other deprecations#
Deprecated
merge()andDataFrame.join()producing duplicated columns when suffixed left and right column labels collide, e.g.suffixes=("_x", "_x"); this will raise aMergeErrorin a future version (GH 13659)Deprecated
DatetimeIndex.snap(); for non-fixed offsets use the offset’srollbackandrollforwardmethods. For fixed frequenciessnapreturns the values unchanged; useDatetimeIndex.round()if rounding was intended (GH 27098)Deprecated
median,min,max,idxmin,idxmax,argmin,argmax,cummin,cummax,clip, and the comparisons<,<=,>,>=oncomplexdata; complex numbers have no natural ordering, so in a future version these will raiseTypeError(GH 43770, GH 70087)Deprecated
DataFrame.iterrows(). UseDataFrame.itertuples()instead (GH 43874)Deprecated
pandas.to_pickle, use theDataFrame.to_pickle()orSeries.to_pickle()method instead (GH 48402)Deprecated passing
Noneentries inobjstoconcat(); filter them out before callingconcat()instead (GH 57846)Deprecated passing a list-like
nametoIndex.copy(); pass the label itself instead (GH 19171)Deprecated passing a negative
min_counttoDataFrame.sum(),DataFrame.prod(),Series.sum(),Series.prod(),TimedeltaIndex.sum(), thesumandprodmethods of pandas arrays, and thesum,prod,min,max,first, andlastmethods ofDataFrameGroupBy,SeriesGroupBy, andResampler. Passmin_count=0instead, which behaves the same (GH 50022)Deprecated setting an out-of-bounds numpy scalar into an array of a numpy-nullable integer dtype. The value is currently stored altered to fit (
np.int64(-1)becomes255inUInt8); in a future version this will raise, as it already does for a Python integer. Cast the array to a dtype that can hold the value first (GH 48867)Deprecated the
DataFrameconstructor,DataFrame.from_dict()withorient="index", andDataFrame.from_records()splitting astrorbytesrow into its elements when the first row is list-like; in a future version this will raiseTypeError. Passlist(row)instead (GH 50461)Deprecated the
cache_datesargument inread_csv(),read_table(), andread_fwf()(GH 68705)Deprecated the
columnskeyword inSeries.drop(), which was silently ignored; useindexorlabelsinstead (GH 39509)Deprecated constructing a
DataFramecolumn,Indexorarray()from a NumPy structured (compound) array, and casting to a compound dtype withDataFrame.astype(),Series.astype()orarray(); these will raise in a future version, as theSeriesconstructor already does. Usepd.DataFrame(arr)for one column per field orarr.astype(object)for tuples (GH 4464, GH 49388, GH 60108)
Performance improvements#
Performance improvement in
DataFrame.apply()withraw=True(GH 66203)Performance improvement in
DataFrame.explode()when exploding multiple columns (GH 53967)Performance improvement in
read_csv()withengine="c"across the board, in tokenizing and in the machinery shared by all column types; large uncompressed local files are additionally read in parallel across multiple CPU cores by default, see above (GH 64347, GH 64515, GH 65350, GH 66271, GH 66272, GH 66273, GH 66274, GH 66276, GH 66798, GH 68314, GH 69632, GH 69748, GH 70140)Performance improvement and reduced memory usage in
DataFrame.loc()andSeries.loc()with aMultiIndexwhen selecting on the first level withslice(None)for the remaining levels (GH 52714)Performance improvement in
eval(),DataFrame.eval()andDataFrame.query()withengine="numexpr"(GH 71806)Performance improvement in
infer_freq()andDatetimeIndex.union()for values with no regular frequency (GH 70884)Performance improvement in
read_csv()with a dictdtypeon wide files or with a smallchunksize(GH 70769)Performance improvement in
DataFrameGroupBy.sum()andSeriesGroupBy.sum()with PyArrow-backed string data (GH 60861)Performance improvement in
DataFrame.skew()andDataFrame.kurt()with types different fromfloat64(GH 66662)Performance improvement in
DataFrame.to_csv()andastype(str)with timezone-aware datetime data (GH 44764)Performance improvement in
DataFrameGroupBy.pct_change()andSeriesGroupBy.pct_change()(GH 70972)Performance improvement in
DataFrameGroupBy.transform()andSeriesGroupBy.transform()with a user-defined function when the input rows are not already ordered by group or NA group keys are dropped (GH 71957)Performance improvement in
DatetimeIndex.strftime(),Series.dt.strftime(), andDataFrame.to_csv()with adate_formatbuilt from%Y,%m,%d,%H,%M,%S,%fand%N(GH 44764)Performance improvement in
MultiIndex.append()andconcat()when combining many objects with aMultiIndexwhose levels have few values in common (GH 70884)Performance improvement in
PeriodIndex.strftime()with a customdate_format(GH 70106)Performance improvement in
RangeIndex.isin(), which no longer builds the full integer array of the index when the values are integers or whole-number floats (GH 66263)Performance improvement in
Series.var(),Series.std(),Series.sem(), and theirDataFrameequivalents when bottleneck is disabled (GH 64884)Reduced
import pandastime on Python 3.15+ by deferring rarely used subsystems with PEP 810 lazy imports (GH 65885)Reduced memory usage of
DataFrame.loc()andDataFrame.iloc()when selecting a single row or a small slice of rows together with a list of columns (GH 69477)Reduced memory usage of
Series.duplicated(), non-uniqueIndex.duplicated(), and the correspondingdrop_duplicatesmethods withkeep="first"orkeep="last"on data with many distinct values (GH 39799)
Bug fixes#
Categorical#
Bug in
DataFrame.values,DataFrame.to_numpy()andDataFrame.transpose()silently converting missing values in aCategoricalcolumn with integer or boolean categories to arbitrary integers orTrue(GH 38240)Bug in
Series.clip()andDataFrame.clip()with ordered categorical data orderinglowerandupperby value instead of by category position (GH 49217)Bug in
Categorical.map(),CategoricalIndex.map()andSeries.map()raisingTypeErroror returning incorrect results when the mapper returned unhashable values such as lists or dicts; these now give an object-dtype result (GH 40892, GH 54359)Bug in comparing a
Categoricalwith an iterator raisingTypeErrorinstead of treating it as a scalar, as with a tuple (GH 31646)Bug in comparing unordered
Categoricalobjects with mixed-type categories in a different order raisingTypeError;Categorical.equals()andmerge()were also affected (GH 51543)
Datetimelike#
Bug in
Timestampconstructor,to_datetime(), andread_csv()withparse_dateswhere a comma used as a date separator was read as a decimal point, silently giving a wrong result (e.g."2013,11,04"parsed as2013-04-01); such strings now raise, andread_csv()leaves the column unparsed (GH 17265)Bug in
infer_freq()returningNonefor a semi-monthlyDatetimeIndex, e.g. one built withfreq="SME"orfreq="SMS"(GH 45819)Bug in
DataFrame.astype(),Series.astype(),Index.astype(),DatetimeIndex,array()andto_datetime()wherefloatdtype data outside theint64range, such asinf, silently became a valid-lookingdatetime64/timedelta64value orNaT; these now raiseOutOfBoundsDatetime/OutOfBoundsTimedelta(GH 68926)Bug in
DataFrame.to_csv()andastype(str)raising for some timezone-aware datetime data outside the range ofdatetime.datetime(GH 44764)Bug in
DatetimeIndex.strftime(),Series.dt.strftime(), andDataFrame.to_csv()withdate_formaton Windows silently replacing values thatTimestamp.strftime()cannot format (e.g.%yfor years before 1900) with their default string representation; these now raiseValueError(GH 58178)Bug in
Series.isin(),DataFrame.isin(), andIndex.isin()on datetime-like data missingnumpy.datetime64ornumpy.timedelta64values (NaT, or any value on numpy < 2.2) whenvaluesalso held non-datetime-like entries (GH 71186)Bug in
Series.quantile()andDataFrame.quantile()withdatetime64ortimedelta64data andinterpolation="linear"or"midpoint"losing precision for large values, so that e.g.q=0did not return the minimum, and returning an incorrect value when the values spanned more than theint64range (GH 49110)Bug in
!=between aTickoffset such asHourand an array-like oftimedelta64values orpd.NAraisingValueErrororTypeError(GH 71162)Bug in comparisons, indexing, setitem and
Series.astype()toCategoricalDtypewith datetime, timedelta or period values not parsingArrowDtypestringandlarge_stringvalues the wayStringDtypevalues are parsed (GH 62051)
Timedelta#
Bug in
Timedeltaandto_timedelta()ignoring a decimal comma in a string, so"00:00:01,500"parsed as 25 minutes instead of 1.5 seconds (GH 71877)
Timezones#
Bug in
DataFrame.query()andDataFrame.eval()comparing a timezone-aware datetime column to a string without a UTC offset raisingTypeErroror returning incorrect results; the string is now localized to the column’s timezone, as indf["col"] < "2000-01-02"(GH 26236)
Numeric#
Bug in
DataFrame.idxmax()with a nullablebooleancolumn containing missing values returning the firstFalserow instead of the firstTruerow (GH 71833)Bug in
Series.skew()andSeries.kurt()(and theirDataFramecounterparts) oncomplexdata discarding the imaginary part; these now raiseTypeError(GH 43770)Bug in
Series.var()andSeries.std()(and theirDataFramecounterparts) returning very inaccurate results for largefloat32data when bottleneck is installed (GH 70945)Bug in arithmetic and comparison operations between integer and
float32data on large inputs computing infloat32instead offloat64when numexpr is installed, losing precision (GH 71272)Bug in in-place arithmetic and logical operations (e.g.
ser += other) upcasting the result or raising whenotherhas index labels not in the left operand (GH 12755)Bug in integer exponentiation (
**,Series.pow(),DataFrame.pow()) on large inputs returning imprecise results,0for negative exponents, or an upcast dtype when numexpr is installed (GH 54546)Fixed bug in
Series.corr()withmethod="pearson"returning an inaccurate result for nearly-constant data, and0.0instead ofNaNfor some constant data (GH 59652)Fixed bug in
Series.isin(),DataFrame.isin(), andIndex.isin()reporting false matches whenvalueswas a list of integers above2**53mixed with floats,NaN, or integers outside theint64range, or a list ofbytesending in a null byte (GH 70217)Fixed bug in
Series.var(),Series.std(), andSeries.sem()(and theirDataFramecounterparts) returninginfor incorrect results forfloat16dtypes when the variance or the number of values exceeded thefloat16range; these now returnfloat64likeSeries.mean()(GH 41277)
Conversion#
Bug in
DataFrameconstructor andDataFrame.from_records()where a list ofSerieswith extension dtypes lost those dtypes (GH 56231)Bug in
to_numeric()raisingTypeErrorfor object values containing 0-dimensionalnumpy.ndarrayelements instead of converting them (GH 47408)Bug in
to_numeric()where a long value with a leading+was not correctly rounded (GH 44145)Bug in
to_numeric()witherrors="coerce"onArrowDtypestring data storing a floatNaNfor unparsable values instead of a missing value, and duplicating a parsed value into the position of a failed parse when the input already contained missing values (GH 67949)Bug in
to_numeric()with a datetime-like scalar not matching the result for aSeriesholding the value (GH 43280)Bug in
DataFrame.compare()andSeries.compare()upcasting integer and boolean columns when the equal values were only in rows dropped from the result (GH 39899)Bug in
DataFrame.from_records()not dropping theexcludeandindexcolumns when all of their labels were falsy, such as0(GH 18679)Bug in
DataFrame.replace()with a dict or list replacing values withNonecasting other columns of the same dtype toobjecteven when they contained no value to replace (GH 30512)Bug in
DataFrame.to_dict()andSeries.to_dict()sometimes returning NumPy complex scalars instead of Pythoncomplex(GH 27616)Bug in
Series.astype()andarray()raisingTypeErrorwhen converting object-dtype data mixing integers and integer strings (e.g.[1, "1"]) to a nullable integer dtype (GH 34460)Fixed bug in
to_numeric()witherrors="coerce"raisingTypeErrorfor object values containing unhashable nested elements, such as a tuple containing a list, instead of coercing them toNaN(GH 69916)
Strings#
Bug in
StringDtypewith PyArrow storage rejecting a PyArrow string scalar in item assignment andSeries.fillna(), andSeries.where()with one storing a character code (GH 71075)Bug in
DataFrame.replace()andSeries.replace()silently ignoring a compiledre.PatternforArrowDtypestringandlarge_stringdtypes, including aCategoricalof them (GH 69026)Bug in
DataFrame.replace()andSeries.replace()withregex=TrueonArrowDtypestringandlarge_stringdtypes raising or silently coercing a replacement the column cannot hold instead of casting toobject(GH 70458)
Interval#
Bug in
IntervalIndex.midandarrays.IntervalArray.midreturning incorrect values for numeric endpoints whose sum overflows their dtype (GH 25499)Bug in
IntervalIndexset operations with an emptyRangeIndex, and inIntervalIndexconstruction orastype("interval")from aRangeIndexor non-interval extension array, raising an uninformativeTypeError(GH 68343)Bug in
arrays.IntervalArraysetitem with a list-like of missing values and thefuture.distinguish_nan_and_naoption enabled storingNaNendpoints instead of a missing interval for a nullable float subtype, or raising for a nullable integer subtype (GH 71950)Bug in
concat()andIndex.append()withIntervalDtypenot retaining an extension dtype subtype, either casting it to a NumPy dtype or raisingTypeError(GH 64297)Bug in
interval_range()with large integerstartorendsilently returning too few intervals, or empty or wrongly spaced intervals, due to float precision loss (GH 71288)Bug in
Series.shift()andDataFrame.shift()with anIntervalDtypecolumn not retaining the subtype, either changing it or raisingTypeError(GH 69922)
Indexing#
Bug in
Indexwhere creating or converting to numpy string dtypes would raiseNotImplementedErrornow raisesTypeError(GH 50127)Bug in
DataFrame.__setitem__()silently corrupting theDataFramewhen the key matched several columns andvaluewas a timezone-awaredatetime64orperiodscalar, or a one-dimensionalSeriesof either dtype; it now broadcasts across the matched columns as the other dtypes already did (GH 71078)Bug in
DataFrame.__setitem__()silently corrupting theDataFramewhen the key matched several unique columns, e.g. a partial date string onDatetimeIndexcolumns;valuenow broadcasts across them (GH 71098)Bug in
DataFrame.__setitem__()silently corrupting theDataFrame, or dropping columns ofvalue, when the key matched several columns (duplicate orMultiIndexcolumns) andvaluewas a two-dimensional array without one column per matched column; it now raisesValueError(GH 68445)Bug in
DataFrame.__setitem__()with a key matching several columns and a one-dimensional extension arrayvalue(e.g.Int64) storing one array for all of them, so a later write to one column changed the others (GH 71098)Bug in
DataFrame.isetitem()with several positions silently corrupting theDataFramewhenvaluewas a scalar or a one-dimensional extension array such asInt64; a scalar now fills every selected column and the array raisesValueError(GH 71098)Bug in
DataFrame.isetitem()with several positions silently corrupting theDataFrame, or dropping columns ofvalue, when an arraylikevaluedid not have one column per position; it now raisesValueError(GH 68445)Bug in
DataFrame.loc()andDataFrame.at()setitem with a single row label adding a new column from a list-like value raising or setting the wrong value (GH 30649)Bug in
DataFrame.loc()andDataFrame.iloc()raising an exception when assigning values using zero-dimensional NumPy array indexers (GH 70256)Bug in
DataFrame.loc()andDataFrame.iloc()raising or flattening a 2D value (e.g. a list of lists) set into a singleobjectcell of a mixed-dtypeDataFrame(GH 69152)Bug in
DataFrame.loc()andDataFrame.iloc()setitem on a 1-columnDataFramewith an extension dtype raising when the column key is an all-Falseboolean mask or an empty list-like (GH 70232)Bug in
DataFrame.loc()andSeries.loc()raisingKeyErrorfor aTrueorFalselabel present in an object-dtypeIndexor the first level of aMultiIndex(GH 50165)Bug in
DataFrame.loc()andSeries.loc()setitem with an integer slice raisingTypeErrorwhere the same.locgetitem succeeds, e.g. on an index ofdecimal.Decimalvalues (GH 70219)Bug in
DataFrame.loc()andSeries.loc()slicing with an integer or float bound that is not in the index: an object-dtype index of numbers (e.g.decimal.Decimal) raisedTypeErrorinstead of slicing by sort order, and a non-monotonic index of non-string values raisedTypeErrorinstead ofKeyError(GH 70295)Bug in
DataFrame.loc()andSeries.loc()with a partial tuple key on a sortedMultiIndexignoring the later levels of the key when a key element equals a level value of a different type, e.g.numpy.datetime64on a level ofdatetime.dateobjects (GH 55969)Bug in
DataFrame.loc()where setting a scalar column with aDataFramevalue failed to align indices properly (GH 58482)Bug in
Index.copy()treating a tuplenameas a list of names (GH 19171)Bug in
Index.difference()dropping elements that are not inotherwhenotherwas aDatetimeIndex,TimedeltaIndexorPeriodIndexand the elements were strings that parse to its values, or whenotherwas anIntervalIndexand the elements were scalars contained in its intervals (GH 58971)Bug in
Series.where()andSeries.mask()with a listotherof nested tuples, such as[(("a", "b"), ("c", "d"))], silently returning wrong values (GH 43780)Bug in comparison operators between an
Indexand itself with a nullable orArrowDtypedtype returning a NumPy boolean array withFalseorTrueat missing positions instead of propagatingNA, inconsistent with comparing against a copy of the sameIndex(GH 71022)Bug in hash-based operations on object-dtype data (e.g.
Series.isin(),factorize(),Index.get_loc()on a uniqueIndex) inconsistently matching a key of a different type that compares equal to a value but hashes differently, such as"float64"andnp.dtype("float64"); these now never match, as with adict(GH 43581)Bug in selecting, setting or dropping with a list of labels that are nested tuples, such as
[(("a", "b"), ("c", "d"))], raisingValueError(GH 43780)
Missing#
Bug in
DataFrame.ffill()andDataFrame.bfill()withaxis=1andinplace=Truenot modifying theDataFrameand returning a new object instead ofself(GH 71159)Bug in
DataFrame.interpolate()andSeries.interpolate()withmethod="index","values","time"or a SciPy method giving incorrect results for a nanosecond-resolutionDatetimeIndexorTimedeltaIndexspanning less than about 104 days, or an integer index with values beyond2**53spanning less than2**53(GH 34601)Bug in
DataFrame.interpolate()andSeries.interpolate()withmethodin"linear","index","values"or"time"ignoringfill_value="extrapolate"and repeating the first or last valid value instead of extrapolating linearly (GH 31949)Bug in
DataFrame.interpolate()andSeries.interpolate()with a largelimitraising on 32-bit platforms and being very slow on long runs of missing values (GH 34936)Bug in
Index.equals()andSeries.equals()returningFalsefor identicalfloat32or complex NaN values in object-dtype data that also holds elements such as aSeries(GH 55492)Bug in
DataFrame.mask(),DataFrame.where(),Series.mask(), andSeries.where()handling missing values in a nullable booleancondinconsistently between the two methods and depending oninplace; missing values are now treated asFalse, as in boolean indexing (GH 35429, GH 52955, GH 56844, GH 60729)Bug in
array(),Series.map(),Index.insert(), theDataFrameconstructor and setting with enlargement with thefuture.distinguish_nan_and_naoption enabled convertingNaNtoNAfor nullable and PyArrow dtypes, or raising forSeries.map()on nullable integer data when every result isNaN(GH 71870)Bug in
Series.drop_duplicates(),Series.unique(),Series.value_counts(),Series.isin()and related methods onobjectdtype treating NumPy NaN scalars such asnp.float64("nan")as distinct values (GH 16632)Bug in
Series.map()andIndex.map()with thefuture.distinguish_nan_and_naoption enabled turningNoneresults and values missing from a dict orSeriesmapper intoNaNinstead ofNAfor nullable and PyArrow dtypes (GH 71949)
MultiIndex#
Bug in
MultiIndexconstructor andMultiIndex.set_codes()silently convertingNaNor non-integer float codes to valid codes instead of raisingValueError(GH 26210)Bug in
DataFrame.dropna()raisingKeyErrorwhensubsetcontained a partial key of aMultiIndex(GH 17737)Bug in
DataFrame.sort_index(),Series.sort_index(),MultiIndex.sort_values()andMultiIndex.is_monotonic_increasing()ignoring the category order of aCategoricalIndexlevel (GH 47607)Bug in
Index.map()raising when mapping to tuples with a different number of elements than aMultiIndexhas levels, or when only some results are tuples (GH 24800)Bug in
MultiIndex.append(),concat(),DataFrame.join()andmerge()emitting a spuriousRuntimeWarningwhenMultiIndexlevel values could not be sorted (GH 61477)Bug in
MultiIndex.from_tuples()with an objectndarray,MultiIndex.append()andIndex.map()truncating or raisingIndexErroron tuples of different lengths;MultiIndex.from_tuples()now raises aValueErrorfor anndarrayof tuples of different lengths (GH 50293)Bug in
MultiIndex.intersection(),MultiIndex.union(),MultiIndex.difference()andMultiIndex.symmetric_difference()with a list-likeotherholding non-tuple entries raisingTypeErroror splitting a string entry into level values; such entries are now treated like anIndexother(GH 39699)Bug in
MultiIndex.rename()raisingTypeErrorfor thenamekeyword documented byIndex.rename()(GH 33778)Bug in
MultiIndex.symmetric_difference()raisingValueErrorwhenotherholds non-tuple entries (GH 39699)Bug in
Series.map(),Index.get_indexer(),DataFrame.reindex()andDataFrame.locwith aMultiIndexraisingIndexErroror matching on a prefix when looking up tuples whose length differs from the number of levels (GH 50293)Bug in
DataFrame.loc()andSeries.loc()setitem with a partialMultiIndexkey (e.g.df.loc[:, "a"] = df.loc[:, "a"] * 2) settingNaN(or raising) instead of the value (GH 10440, GH 15310, GH 40186, GH 43719, GH 45751, GH 46837)
I/O#
read_csv()withengine="pyarrow"now raisesValueErrorfor the unsupportedencoding_errorswith bytes or file input instead of silently ignoring it (GH 71298)Bug in
DataFramerepr andDataFrame.to_string()where numeric column labels of differing widths were misaligned with their column’s values (GH 8300)Bug in
json_normalize()where ametapath not followingrecord_pathraisedKeyErroror silently returned a same-named field from the wrong object (GH 60254)Bug in
read_csv()silently misparsing non-ASCIIthousandsanddecimalmarkers with the C engine; these now fall back to the Python engine with aerrors.ParserWarning, or raiseValueErrorifengine="c"is explicitly specified (GH 71158)Bug in
read_csv()where adtypegiven for aparse_datescolumn undid the date parsing, returning strings, objects, integers or categories instead of datetimes (GH 57512)Bug in
read_csv()withengine="c"andcommentnot skipping a line containing only whitespace before the comment character (GH 55916)Bug in
read_csv()withengine="c"andskiprowstreating a quote in a skipped leading line as opening a field, skipping the wrong lines or raisingEmptyDataError(GH 34732)Bug in
read_csv()withengine="c"occasionally dropping leading whitespace from the first value of a line in large inputs (GH 34085)Bug in
read_csv()withengine="c"shifting a row’s values one column left when the row starts with the delimiter and follows a blank, comment, or skipped line in a file with\rline endings (GH 71409)Bug in
read_csv()withengine="pyarrow"andparse_datesconverting a non-dateindex_col(e.g. integers) to strings (GH 71873)Bug in
read_csv()withengine="pyarrow"raisingEmptyDataErrorfor input whose only line lacks a trailing newline (GH 62635)Bug in
read_csv()withengine="pyarrow"silently wrapping values outside the range of the requested integerdtypeinstead of raising (GH 38013)Bug in
read_csv()withengine="python"andindex_colreading a date like"20180101"as nanoseconds since the epoch whendtypeis a pyarrow timestamp dtype (GH 24542)Bug in
read_csv(),read_excel(),read_fwf()andread_html()returning wrong column labels and treating header rows as data whenheaderwas a list not in increasing order, such asheader=[1, 0](GH 47011)Bug in
read_csv(),read_html()and other I/O functions raisingUnicodeEncodeErrorfor URLs containing non-ASCII characters (GH 21499)Bug in
read_csv(),DataFrame.to_csv()and other I/O functions raisingURLErrorforsftp://URLs instead of reading or writing them withfsspec(GH 46765)Bug in
read_excel()raisingValueErrorwhenheaderis a list andindex_colconsumes all columns (GH 66372)Bug in
read_html()raisingImportErrorwhenlxmlis not installed instead of falling back tobs4+html5libwith the defaultflavor=None(GH 30281)Bug in
read_html()with thebs4orhtml5libparser dropping tables that have identical content, so only the first was returned (GH 49934)Bug in
read_json()raisingValueErroron numbers whose integer part does not fit inint64oruint64(e.g.100000000000000000000.5), and silently returning a wrong value for some of them (GH 20599)Bug in
read_orc()raising wheneverfilesystemwas passed (GH 58746)Bug in
read_sas()exhausting memory instead of raisingValueErroron a SAS7BDAT file that claims more rows than it can hold, when read from an uncompressed file, a zip archive, or aBytesIO(GH 70721)Bug in
read_sas()returning rows that were deleted from an uncompressed SAS7BDAT file (GH 15963)Bug in
read_sas()withformat="xport"reading zeros as5.397605e-79(GH 50670)Bug in
read_xml()withnamesand aniterparselist repeating a name, where values were shifted into the wrong column or dropped in large files or when repeated values were equal or empty (GH 71275)Bug in
DataFrame.to_csv()withMultiIndexcolumns and an unnamed index orindex_label=Falsewhere a first row of missing values was read back byread_csv()as the index names and dropped; an empty index-names line is now written in this case (GH 21995)Bug in
DataFrame.to_csv(),DataFrame.to_json(),DataFrame.to_pickle()and similar writers where writing to afile://URL raised for a new file and silently left an existing file unchanged; writing to other URLs such ashttp://now raises instead of silently discarding the data (GH 55828)Bug in
DataFrame.to_excel()where aNaNlabel inMultiIndexcolumns was written as the last value of that level instead of an empty cell (GH 62340)Bug in
DataFrame.to_json()andSeries.to_json()dropping the nanoseconds of tz-aware datetime columns andTimestampobjects, and withdate_format="epoch"mis-rounding pre-1970datetimeobjects or raisingOverflowErrorfor ones outside the nanosecond bounds at a coarserdate_unit(GH 53473)Bug in
DataFrame.to_parquet()withengine="pyarrow"where a misspelled keyword argument truncated an existing file at the destination or was reported as an error about the path (GH 45815)Bug in
DataFrame.to_sql()creating MySQL and MariaDB datetime and time columns that silently dropped fractional seconds (GH 48435)Bug in
DataFrame.to_sql()withif_exists="append"orif_exists="delete_rows"writing to an existing table hanging on SQL Server while another session had uncommitted changes to an unrelated table (GH 52601)Bug in
DataFrame.to_sql()withif_exists="delete_rows"raisingInvalidRequestErrorfor an existing temporary table (GH 52601)Bug in
DataFrame.to_stata()raisingValueErrorfor an empty DataFrame with a categorical column, andread_stata()not converting the column back to a categorical (GH 71126)Bug in
DataFrame.to_string(),Series.to_string()andDataFrame.to_html()ignoringna_repforNone,pd.NA, andNaTvalues in object-dtype columns and an explicitna_rep="NaN"for any missing value, and inDataFrame.to_xml()raising forna_repwith nullable, pyarrow-backed, or categorical columns containing missing values (GH 54872)Bug in
DataFrame.to_string(),Series.to_string()and theirreprwhere values or labels containing ANSI color codes were counted toward the column width, misaligning the other rows (GH 55122)Bug in displaying a
SeriesorDataFramein IPython withdisplay.html.table_schemaenabled printing a traceback when the data cannot be converted to JSON, such as non-UTF-8bytes(GH 16848)Bug in the display of a
MultiIndex(repr,DataFrame.to_string(),DataFrame.to_html(),Styler) where distinct labels that display identically (e.g.1and"1") were shown as a single label;DataFrame.to_excel()merged them into one cell, losing all but the first value (GH 10796)Bug in the repr of a
SeriesorDataFramewhere values displayed as0by thedisplay.chop_thresholdoption still caused the column to be shown in scientific notation (GH 12374)Bug in the repr of a
SeriesorDataFramewithlongdouble(e.g.float128) dtype showing values outside thefloat64range as0orinf(GH 17809)Fixed bug in
read_csv()where callableskiprowsreceived incorrect row numbers on 32-bit big-endian architectures (GH 69985)Bug in
ExcelWriterwithengine="openpyxl"ignoringdate_formatanddatetime_format(GH 44284, GH 59882)read_json()withorient="table"now reads back non-string column labels and index names, such as the default integer columns ofDataFrame([[1, 2]]), instead of returning all-NaN values or raisingIntCastingNaNError; labels it cannot match to the data, such as5alongside"5", now raiseValueError(GH 19129)DataFrame.to_json()andSeries.to_json()withorient="table", andbuild_table_schema(), no longer raiseAttributeErrorfor aMultiIndexwith non-string level names (GH 19129)Bug in
read_csv()where usingengine="python"with customconvertersreturning unhashable types (such as lists or dicts) raisedTypeError(GH 56848)Bug in
read_excel()withdtype_backend="numpy_nullable"converting mixed-type columns anddatetime.timecolumns to string dtype; such columns now preserve object dtype and the original Python types (GH 63830)Bug in
read_excel()withdtype_backend="pyarrow"raisingpyarrow.ArrowInvalidfor columns with mixed types (e.g. integers and strings); such columns now fall back to object dtype, matching the default behaviour withoutdtype_backend="pyarrow"(GH 63830)Bug in
read_json()withorient="table"raising for a tz-naivedatetimefield whose values carry a UTC offset, such as files written by pandas before 1.5; the values are now converted to UTC (GH 52595)Bug in
read_json()withtyp="series"returningdatetime64dtype for all-null data instead offloat64, matchingDataFramecolumns (GH 35464)Bug in
read_sas()raisingIndexErroror reading the wrong format or label for SAS7BDAT files with columns renamed or relabeled after the file was written (GH 60809)Bug in
read_sql_query()andread_sql_table()with a SQLAlchemy connection returning column labels that requiresqlalchemyto unpickle (GH 52816)Bug in
read_sql()andread_sql_query()raising or altering a query containing an unescaped%and noparamswhen using a SQLAlchemy connection to a database driver such aspymysqlorpsycopg2(GH 49561)Bug in
DataFrame.to_json()andSeries.to_json()withorient="table"declaring complex data as a"number"field thatread_json()then failed to read withTypeError; it now round-trips (GH 50782)Bug in
DataFrame.to_json()andSeries.to_json()writing floats near the largestfloat64value in a form that reads back asinf(GH 21454)Bug in
HDFStore.append()raisingValueError: Buffer dtype mismatchinstead of the “different categories” error when appending a categorical whose categories have a different dtype than the existing ones (GH 71128)Bug in
HDFStore.remove()deleting unselected rows when passing unsorted row coordinates (GH 71276)Bug in
HDFStore.select()andHDFStore.select_as_multiple()returning the wrong rows when combiningwherewithstartorstopandchunksizeoriterator(GH 71278)Bug in
Series.to_json()withorient="table"writing a falsySeriesname such as0,Falseor""as"values"(GH 19129)Bug where the pickled bytes (e.g. for
joblib.hash) of aSeries,DataFrameorIndexwith datetimelike or extension-dtype data depended on which operations had previously been run on it (GH 49170)Fixed a segfault in
DataFrame.to_json()andSeries.to_json()withdate_format="iso"when datetime conversion raises an exception (GH 69461)
Period#
Bug in
PeriodIndexandarray()with a perioddtyperaising when given a list of nanosecond-unitnp.datetime64values, andPeriodIndexraisingAttributeErrorinstead ofValueErrorfordatetime64data without afreq(GH 70139)Bug in
Periodconstructor where the string of a weeklyPeriodsuch as"2011-12-26/2012-01-01"or"2000-01-03/2000-01-09"was silently parsed as a minute-frequencyPeriod(GH 48000)Bug in
Period,PeriodIndex,period_range()and casting toPeriodDtypesilently dropping the timezone of timezone-aware input; these now emit aUserWarninglikeTimestamp.to_period()(GH 47005)Bug in
Period.strftime()andPeriodIndex.strftime()where%Ywas not zero-padded for years before 1000 on Linux (GH 48746)
Plotting#
Bug in
plotting.table()ignoringrowLabelsandcolLabelsor raising aTypeErrorwhen they were passed (GH 37811)Bug in
DataFrame.hist()andSeries.hist()raisingValueErrorwhen passingweightstogether withby(GH 9540)Bug in
DataFrame.hist()withbyand nocolumnplotting the numeric grouping column alongside the other columns (GH 41188)Bug in
DataFrame.plot.hist()withbyraisingTypeErrorwhenbinswas a sequence of bin edges (GH 11483)Bug in
DataFrame.plot.hist()withsubplots=Trueandsharex=Falseusing the same bins for every subplot, so columns on a smaller scale collapsed into a single bar (GH 13489)Bug in
DataFrame.plot.pie()andSeries.plot.pie()silently ignoringcolor(GH 11228)Bug in
DataFrame.plot()andSeries.plot()drawing data indexed by period-end timestamps (e.g.freq="ME"or"W") at the start of each period when combined with a higher-frequency series on the same or shared axes (GH 11574)Bug in
DataFrame.plot()andSeries.plot()ignoringstylewhenxerroryerris passed (GH 7023)Bug in
DataFrame.plot()andSeries.plot()ignoring theaxes.grid.axisandaxes.grid.whichrcParams, e.g. from a style file, and drawing major gridlines on both axes (GH 17725)Bug in
DataFrame.plot()andSeries.plot()raisingValueErrorwhen plotting a single series or column withcoloras a tuple of three or four colors, instead of treating it like the equivalent list (GH 18449)Bug in
DataFrame.plot()andSeries.plot()withkind="bar"orkind="barh"raisingTypeErrorontimedelta64data containingNaT(GH 39320)Bug in
DataFrame.plot()andSeries.plot()withstyleas a tuple,np.ndarrayorSeriesplotting the styles as data instead of applying them like the equivalent list (GH 46289)Bug in
DataFrame.plot()andSeries.plot()with aTimedeltaIndexthat has no regular frequency, or withx_compat=True, plotting the points evenly spaced and leaving most x-axis ticks unlabeled (GH 19965)Bug in
DataFrame.plot()andSeries.plot()with a regular-frequencyDatetimeIndexorPeriodIndexcutting off data already plotted on axes sharing the x-axis (sharex=True) (GH 14074)Bug in
DataFrame.plot()andSeries.plot()with a regular-frequencyDatetimeIndexorPeriodIndexmislabeling ticks set withxticks=orax.set_xticks(GH 18881)Bug in
Series.plot()andDataFrame.plot()drawing datetimes outside the visible range when they share the x-axis (sharex=True,twinx, orsecondary_y=True) with a time-series plot (GH 14322, GH 40470)Bug in
Series.plot.hist()andDataFrame.plot.hist()withdatetime64data drawing only empty bars (GH 17372)Bug in
Series.plot()andDataFrame.plot()raising when a datetime index containingNaTis drawn on a time-series axes (GH 40470)Bug in
Series.plot()andDataFrame.plot()widening the x-axis to start at 1970 when a time series is added to a time-series plot that holds anaxhline(GH 71436)Bug in
Series.plot()andDataFrame.plot()with a timezone-aware index raisingValueErrorwhen the first timestamp falls in a daylight saving time transition, e.g. the repeated hour of a fall-back day (GH 62936)
Groupby/resample/rolling#
Bug in
DataFrameGroupBy.apply()andSeriesGroupBy.apply()withgroup_keys=Falsenot preserving the order of the rows of the input when the index has duplicates (GH 57906)Bug in
DataFrameGroupBy.cumsum(),DataFrameGroupBy.cummin(),DataFrameGroupBy.cummax(), andDataFrameGroupBy.rank()(and Series variants) ondatetime64,timedelta64, andPeriodDtypedata treatingNaTas a regular value and losing precision when the group key containsNA(GH 69923)Bug in
DataFrameGroupBy.cumsum(),DataFrameGroupBy.cumprod(),DataFrameGroupBy.cummin(),DataFrameGroupBy.cummax(), andDataFrameGroupBy.rank()raisingNotImplementedError, often with no message, instead ofTypeErroron columns that do not support them, e.g.objectcolumns andArrowDtypedate, time and binary columns (GH 69791)Bug in
DataFrameGroupBy.max(),DataFrameGroupBy.min(),DataFrameGroupBy.cummax(), andDataFrameGroupBy.cummin()(and Series variants) on nullable float data with thefuture.distinguish_nan_and_naoption enabled returninginfor-inffor all-NaNgroups and ignoringNaNin other groups;NaNnow propagates as inDataFrameGroupBy.sum(); under the default option,ArrowDtypefloat data containingNaNnow givesNAinstead of ignoring theNaN(GH 59106)Bug in
DataFrameGroupBy.resample()followed byResampler.aggregate()with a list of functions aggregating the grouping andoncolumns, raisingTypeErroror returning them as extra result columns (GH 32162)Bug in
DataFrameGroupBy.shift()andDataFrameGroupBy.pct_change()withfreqincluding the grouping columns in the result, or raising for non-numeric grouping columns (GH 46944)Bug in
DataFrameGroupBy.shift(),SeriesGroupBy.shift(),DataFrameGroupBy.diff(), andSeriesGroupBy.diff()withperiods=0not setting rows with an NA group key to missing (GH 70996)Bug in
DataFrameGroupBy.sum(),SeriesGroupBy.sum()andDataFrame.sum()withaxis=1ignoringmin_countforArrowDtypestring data (GH 60861)Bug in
DataFrameGroupBy.transform()with a function returning a scalar for each column casting the results to a common dtype (GH 42617)Bug in
GroupBy.median(),GroupBy.skew(), andGroupBy.kurt()oncomplexdata silently discarding the imaginary part; these now raiseTypeError(GH 43770)Bug in
GroupBy.quantile()raisingNotImplementedErrorwith no message, instead ofTypeError, onArrowDtypecolumns it does not support, e.g. binary columns (GH 69808)Bug in
GroupBy.std()andGroupBy.sem()oncomplexdata silently discarding the imaginary part, andGroupBy.var()raising; these now matchSeries.std(),Series.sem(), andSeries.var()(GH 43770)Bug in
Rolling.aggregate()withonraisingValueErrorwhen a column is given a list of functions, e.g.agg({"B": ["min", "max"]})(GH 43769)Bug in
SeriesGroupBy.transform()with a callable raising forSeriessubclasses that cannot hold the transformed values; the result now falls back to the type the subclass chooses (geopandas/geopandas#3059, GH 71165)Bug in
SeriesGroupBy.value_counts()returning counts attached to the wrong interval when the passedbinsresulted in empty counts (GH 32471)Bug in
DataFrame.agg(),DataFrameGroupBy.agg(), and resample/rollingaggwith a dict, list, or named aggregation over more than 100 columns emitting a spuriousPerformanceWarningwithas_index=Falseor on a laterDataFrame.reset_index()(GH 61628)Bug in
DataFrame.groupby()andSeries.groupby()withsort=Trueanddropna=Falseplacing theNaNgroup in the middle of the result instead of last for object-dtype keys;Index.union()had the same misordering (GH 70216)Bug in
DataFrame.groupby(),DataFrame.resample(),DataFrame.rolling(),DataFrame.expanding(), andDataFrame.ewm()raisingTypeErrorwhen selectingMultiIndexcolumns with a tuple key (GH 13914)Bug in
DataFrame.resample(),Series.resample(), andGrouperraisingNotImplementedErrorwhenruleorfreqis a genericDateOffset(e.g.DateOffset(months=1)) (GH 31697)Bug in
Series.resample()andDataFrame.resample()with aPeriodIndexandclosed="right"returning shifted labels or incorrect aggregations (GH 44363)Bug in
Series.resample()andDataFrame.resample()with a timezone-aware index and aDayor anchored frequency (e.g."D","W-FRI") raising when a bin edge fell on a midnight that does not exist or is ambiguous due to a daylight saving time transition (GH 62601)Bug in time-based
Rolling.cov()andRolling.corr()raisingValueErroror silently returning wrong results whenotherhas a different index; the result is now computed on the aligned index, as with integer windows. Withon, a mismatched index now raisesValueError(GH 62937)
Reshaping#
Bug in
concat()and theDataFrameconstructor losing thefreqof aDatetimeIndexorTimedeltaIndexdepending on the order of the inputs (GH 64253)Bug in
concat()raisingArrowInvalidwhen casting integers exceeding2**53to a PyArrow float dtype, e.g.int64[pyarrow]withuint64[pyarrow]; these now round as with NumPy dtypes (GH 58819)Bug in
concat()raisingValueErrorwhen tuplekeyscontain a missing value such asNone(GH 57993)Bug in
merge_asof()withright_index=Trueand an emptyleftreturning the index ofrightinstead ofleft(GH 41171)Bug in
merge()raisingValueErrorwhen merging a numeric key with anobjectkey that is not all strings, e.g.[1.5, None],[1.5, "a"], or an empty or all-missing key (GH 70218)Bug in
DataFrame.pivot()andpivot()with a list ofvaluescasting the pivoted columns to a common dtype, e.g. integers tofloat64orobject(GH 43547)Bug in
DataFrame.pivot(),DataFrame.pivot_table(),DataFrame.unstack()andSeries.unstack()raisingTypeErroron complex data when the result has missing cells (GH 25221)Bug in
DataFrame.stack()where missing labels in the result’sMultiIndexcould not be found by lookups such as.loc; unstacking such a result now places the missing label first unlesssort=Falseis passed (GH 40366)
Sparse#
Bug in setting integer
SparseDtypevalues into an integerSeriesorIndex(__setitem__,.loc,.iloc,Series.where(),Series.mask(),Series.update(),Index.putmask()) raisingAttributeError: 'SparseDtype' object has no attribute 'itemsize'(GH 68457)
ExtensionArray#
Bug in
read_csv()and other parsing of strings into a decimalArrowDtyperaisingArrowInvalidinstead of parsing the values (GH 69838)Bug in
ArrowExtensionArray.factorize()ignoringuse_na_sentinel=Truefor dictionary-encoded PyArrow data that stores nulls as dictionary values, keeping the null in the returneduniquesor raisingArrowInvalidfor chunked data (GH 66490)Bug in
DataFrame.apply()andDataFrame.aggregate()where a single callable reducing each column (or row) of a nullable- or PyArrow-backed frame to a scalar gave a NumPy-dtyped result, e.g.float64rather thandouble[pyarrow](GH 61812)Bug in
Series.dt.strftime()on PyArrow-backed timestamp and date data where%Sincluded fractional seconds and%fand%Nwere not supported (GH 55001)Bug in
Series.isin(),DataFrame.isin(), andIndex.isin()on PyArrow-backed dtypes raising whenvaluesheld a mix of types PyArrow cannot combine (GH 70300)Bug in
Series.mode()andDataFrame.mode()withdropna=FalseraisingTypeErrorfor"boolean"dtype (GH 70487)Bug in
Series.rank()raisingArrowNotImplementedErrorfor anArrowDtypethat PyArrow cannot rank, such aslist[pyarrow]; the values are now ranked as Python objects, so lists rank lexicographically (GH 69136)Bug in the
DataFrameconstructor with adtypesuch as"Float64"not copying its input when it should, so that writes to one changed the other and operations likeDataFrame.unstack()could be very slow (GH 52338)Bug in
Series.replace(),Series.where(),Series.fillna(), item assignment and related methods on a PyArrow-backed integer dtype silently truncating a fractional value, including one passed in a list (replace(2, 1.5)stored1); these now raiseTypeError, whileIndex.where(),Index.putmask()andIndex.fillna()upcast, matching the nullable integer dtypes (GH 68638, GH 71076)Bug in
Series.skew()andSeries.kurt()(and theirDataFramecounterparts) on PyArrow-backed numeric data returning an arbitrary value for constant data, losing precision on data with a large offset, and raisingTypeErrorwith pyarrow < 20; undefined results are nowNAinstead ofNaN, matching the nullable float dtypes (GH 71829)Bug in
Series.value_counts()withdropna=Falseon nullable dtypes placing missing values last (or last among equal counts) instead of in order of first appearance (GH 23074)Bug in arithmetic and logical operations on PyArrow-backed data raising
pyarrow.ArrowInvalidorpyarrow.ArrowTypeErrorinstead ofTypeErrorwhen the other operand contains objects PyArrow cannot convert (GH 62682)Bug in comparisons between PyArrow-backed data and objects PyArrow cannot convert raising
pyarrow.ArrowInvalidorpyarrow.ArrowTypeError;==/!=now compare elementwise, ordered comparisons raiseTypeError, and a missing value on either side propagates instead of answeringFalse(GH 62682)Bug in constructing or setting values into a numeric, boolean or temporal
ArrowDtypefrom a NumPy string array sometimes crashing the interpreter or returning incorrect values (GH 71827)
Styler#
Bug in
Stylermethods taking alevelargument, such asStyler.hide()andStyler.format_index(), ignoring or raising on negative, out-of-range or NumPy integer levels;levelis now resolved as inDataFrame.droplevel(), so an integer matching a level name refers to that level (GH 42933)Bug in
Stylermethods taking asubsetargument, such asStyler.format(),Styler.map()andStyler.hide(), raisingKeyErrorfor a callablesubset(GH 46685)Bug in
Styler.background_gradient()andStyler.text_gradient()coloring missing values with the lowest colormap color instead of the missing-value color when all valid values in a column, row, or table were equal (GH 47695)Bug in
Styler.bar()raisingTypeErrorfor data containingpd.NAwhenalignis"mean"or a callable, or whencmapis given (GH 56425)Bug in
Styler.map(),Styler.apply()andStyler.set_table_styles()truncating CSS values that contain a;inside quotes or parentheses, such asurl("data:image/png;base64,...")(GH 59623)Bug in
Styler.to_excel()applying styles to the wrong columns whencolumnsselects or reorders columns (GH 42276)Bug in
Styler.to_html()where Chrome and other Chromium-based browsers did not apply a style shared by more than 8192 cells to the cells beyond the first 8192 (GH 40913)
Other#
Bug in
api.interchange.from_dataframe()withallow_copy=Falsealways raisingRuntimeErrorfor objects supporting the Arrow PyCapsule Interface, even when a zero-copy conversion is possible (GH 71189)Bug in
eval()with a multi-line expression and atargetraisingUndefinedVariableErrorwhen a line after the first referenced a variable (GH 31952)Bug in
eval(),DataFrame.eval()andDataFrame.query()wherenotperformed a bitwise inversion instead of a logical negation, e.g.pd.eval("not True")returned-2anddf.query("a > 1 and not True")could return rows (GH 11367)Bug in
testing.assert_series_equal()andtesting.assert_frame_equal()withcheck_dtype=Falseandcheck_exact=Truecomparing missing values against an object column differently fromcheck_exact=False;pd.NAandNaTno longer matchnp.nanorNone(GH 61473)Bug in
testing.assert_series_equal(),testing.assert_frame_equal()andtesting.assert_index_equal()treatingnp.nanandNoneas equal when they appear inside NumPy arrays stored in object-dtype values (GH 55492)Bug in
util.hash_array()andutil.hash_pandas_object()raisingUnicodeDecodeErroron mixed-type object values containing non-ASCIIbytes;bytesin mixed-type values now hash the same as in non-mixed ones (GH 27215)Bug in
DataFrame.agg()with a list of functions raisingArrowInvalidon pyarrow-backed columns with large integer results (GH 71875)Bug in
DataFrame.agg(),Series.agg()and theaggmethods of groupby, resample and window objects silently ignoring*argsand**kwargswhenfuncis a dict, e.g.df.agg({"a": "sum"}, min_count=1); they are now passed to each function, as with a list of functions, so a function that does not accept them now raisesTypeError(GH 23889)Bug in
DataFrame.apply()withraw=Truecasting scalar results to the dtype of the first one, e.g.1followed by2.5gave2; the dtype is now inferred from all results, as withraw=False(GH 61632)Bug in
DataFrame.duplicated()andDataFrame.drop_duplicates()raisingValueErrorwhensubsetis an empty list; no rows are now marked as duplicates, matching aDataFramewith no columns (GH 12869)Bug in
DataFrame.eval()andDataFrame.query()withengine="numexpr"where a column used again in a later line of a multi-line expression, or after a subscript such asa[a > 0], was treated as a NumPy array, raisingTypeErroror silently giving wrong results;eval()also no longer replaces the values of a passedresolversmapping with NumPy arrays (GH 59062)Bug in
DataFrame.eval(),DataFrame.query(), andeval()with the defaultengine="numexpr"raisingRecursionErrorfor arithmetic between object or string columns (e.g."a + b"on two string columns) andValueErrorfor an expression that is a single object or string column or string literal, such as"c = 'foo'"(GH 15320, GH 21088, GH 27639)Bug in
DataFrame.eval(),DataFrame.query(), andeval()raisingTypeErrorwhen adding a string to an object or string column, e.g.df.eval("a + 'x'")(GH 47734)Bug in
DataFrame.eval(),DataFrame.query(), andeval()with the defaultengine="numexpr"raisingValueErrorfor a unary operator such asnoton an object or string column (GH 45876)Bug in
DataFrame.from_dict()withorient="index"silently setting a row’s values toNaNwhen its tuple key containedNoneorNaN(GH 28390)Bug in
DataFrame.query()andDataFrame.eval()raisingValueErrororUndefinedVariableErrorwhen the expression callsTimestamp,datetime,listortuple, e.g.df.query("a > Timestamp('2020-01-01')")(GH 50442)Bug in
DataFrame.query()andDataFrame.eval()where==and!=against a string gave different results than the same comparison outside ofquery, e.g. returning no rows for adatetime64,timedelta64, orPeriodDtypecolumn, or raisingNotImplementedErrorwithparser="python"(GH 54199)Bug in
DataFrame.query()andDataFrame.eval()where a column namedinforInfwas ignored in favor ofnp.inf, raisingKeyErroror silently returning wrong results (GH 47859)Bug in
DataFrame.query()andDataFrame.eval()withengine="numexpr"raisingAttributeErrorfor some comparisons andin/not inchecks whose operand is a math function or unary operator, e.g.abs(a) in [1, 2](GH 31848)Bug in
Index.get_loc(),Series.value_counts(),Series.duplicated(),Series.isin()and other object-dtype operations where aSystemExitraised by a custom__hash__or__eq__was silently suppressed (GH 57052)Bug in calling a generalized ufunc on a
SeriesraisingAttributeErrorwhen it reducedobjectdata to a single object pandas does not recognize as a scalar, e.g.shapely.geometrycollectionsreturning a geometry (GH 71109)Bug in
eval(),DataFrame.eval(), andDataFrame.query()raising on somedatetime64andtimedelta64operations, e.g.df.query("time > @now - @delta"), and returningfloat32for afloat32column times anp.timedelta64(GH 30729, GH 52559)Bug in
DataFrame.eval()andeval()where assigning to a backtick-quoted name that is not a valid Python identifier, e.g.df.eval("`a-b` = a + b"), created a column labeledBACKTICK_QUOTED_STRING_a_MINUS_binstead of"a-b"(GH 47699)Bug in
DataFrame.replace()andSeries.replace()withinplace=Trueand a list-like or dictto_replaceusing memory proportional to the number of values to replace times the length of the data, raisingMemoryErrorfor large mappings (GH 25816)Bug where configuration options and pandas’ C extension modules could be left uninitialized when running under Python’s global lazy imports mode (
-X lazy_imports=all) (GH 71173)
Contributors#
A total of 101 people contributed patches to this release. People with a “+” by their names contributed a patch for the first time.
ASWANTH R +
Aahan G +
Aarya +
Aarya Prakash +
Aarya2004 +
Abhishek Kumar +
Abhishek kr. Chauhan +
Abhishek1106kr +
Aidan Feldman
Ammar Hassona +
Anirudh +
Aniruktha +
Anushka Dudhe +
Atik +
Ayush Kumar +
Ayush Srivastava +
Breno Barreto +
Brock
Chaimaa Abi +
Chetan Sahney +
Davin Khotob +
Deon Binny +
DeviousCardi +
Dr-Irv
Enrico Lockner +
Eugenio “Jay” Zuccarelli +
Fangchen Li
Filipe Rangel +
Furqan Khan +
GON +
Ge Li +
Gore Williams +
H23 +
Iason Krommydas +
Igor Souza Lima +
Ishaan
Ishan Kumar +
Itssubhraneelbruv +
Johnny Kao +
Johnny Wilson Dougherty +
Joris Van den Bossche
Juan Miguel Contreras +
Julian Harbeck
Junpei Zhang +
Koussay-mehdouani +
Krishn +
Laraib Butt +
Leo Camus +
Likhitha J +
Maha Rana Yadavalli +
Maha Yadavalli +
Mannava Daasaradhi +
Manvi Soni +
Matthew Roeschke
Minh Tuan Pham +
Mohd Maaz Khan +
Monika Dvorackova +
N3verm1nd
Natalia Mokeeva
Noah
Odysseas Yiakoumis +
Pablo Galindo Salgado +
Parman Mohammadalizadeh +
Pieter Eendebak +
Pranav Choudhary
Riaz1729 +
Richard Shadrach
Ryan George +
S.A +
Saihritesh
SamuelOndrus +
Seungtaek Oh +
Sharathkumara +
Shriraj Jadhav +
Shuheng (Markus) Ma +
Sugandh Garg +
TensorDevLJ +
Tharoboiz +
Tiereonna +
Trinh Quoc Anh
Trupti603 +
Vincent Ngo +
Vividh Yadav +
Weijian He +
Wrethis +
britz +
furqankhan +
guptaishaan
jbrockmendel
layeh +
maharanay22 +
matiaslindgren
pei711 +
ramchaser
root
sundeep8967 +
tanveer-arch +
ump45nose
yuchen-xu +
Álvaro Kothe
“galleonli” +