What’s new in 3.0.0 (Month XX, 2024)#
These are the changes in pandas 3.0.0. See Release notes for a full changelog including other versions of pandas.
Enhancements#
enhancement1#
enhancement2#
Other enhancements#
pandas.api.typing.FrozenList
is available for typing the outputs ofMultiIndex.names
,MultiIndex.codes
andMultiIndex.levels
(GH 58237)pandas.api.typing.SASReader
is available for typing the output ofread_sas()
(GH 55689)DataFrame.to_excel()
now raises anUserWarning
when the character count in a cell exceeds Excel’s limitation of 32767 characters (GH 56954)read_stata()
now returnsdatetime64
resolutions better matching those natively stored in the stata format (GH 55642)Styler.set_tooltips()
provides alternative method to storing tooltips by using title attribute of td elements. (GH 56981)Allow dictionaries to be passed to
pandas.Series.str.replace()
viapat
parameter (GH 51748)Support passing a
Series
input tojson_normalize()
that retains theSeries
Index
(GH 51452)Support reading value labels from Stata 108-format (Stata 6) and earlier files (GH 58154)
Users can globally disable any
PerformanceWarning
by setting the optionmode.performance_warnings
toFalse
(GH 56920)Styler.format_index_names()
can now be used to format the index and column names (GH 48936 and GH 47489)errors.DtypeWarning
improved to include column names when mixed data types are detected (GH 58174)DataFrame.cummin()
,DataFrame.cummax()
,DataFrame.cumprod()
andDataFrame.cumsum()
methods now have anumeric_only
parameter (GH 53072)DataFrame.fillna()
andSeries.fillna()
can now acceptvalue=None
; for non-object dtype the corresponding NA value will be used (GH 57723)Series.cummin()
andSeries.cummax()
now supportsCategoricalDtype
(GH 52335)
Notable bug fixes#
These are bug fixes that might have notable behavior changes.
Improved behavior in groupby for observed=False
#
A number of bugs have been fixed due to improved handling of unobserved groups (GH 55738). All remarks in this section equally impact SeriesGroupBy
.
In previous versions of pandas, a single grouping with DataFrameGroupBy.apply()
or DataFrameGroupBy.agg()
would pass the unobserved groups to the provided function, resulting in 0
below.
In [1]: df = pd.DataFrame(
...: {
...: "key1": pd.Categorical(list("aabb"), categories=list("abc")),
...: "key2": [1, 1, 1, 2],
...: "values": [1, 2, 3, 4],
...: }
...: )
...:
In [2]: df
Out[2]:
key1 key2 values
0 a 1 1
1 a 1 2
2 b 1 3
3 b 2 4
In [3]: gb = df.groupby("key1", observed=False)
In [4]: gb[["values"]].apply(lambda x: x.sum())
Out[4]:
values
key1
a 3
b 7
c 0
However this was not the case when using multiple groupings, resulting in NaN
below.
In [1]: gb = df.groupby(["key1", "key2"], observed=False)
In [2]: gb[["values"]].apply(lambda x: x.sum())
Out[2]:
values
key1 key2
a 1 3.0
2 NaN
b 1 3.0
2 4.0
c 1 NaN
2 NaN
Now using multiple groupings will also pass the unobserved groups to the provided function.
In [5]: gb = df.groupby(["key1", "key2"], observed=False)
In [6]: gb[["values"]].apply(lambda x: x.sum())
Out[6]:
values
key1 key2
a 1 3
2 0
b 1 3
2 4
c 1 0
2 0
Similarly:
In previous versions of pandas the method
DataFrameGroupBy.sum()
would result in0
for unobserved groups, butDataFrameGroupBy.prod()
,DataFrameGroupBy.all()
, andDataFrameGroupBy.any()
would all result in NA values. Now these methods result in1
,True
, andFalse
respectively.DataFrameGroupBy.groups()
did not include unobserved groups and now does.
These improvements also fixed certain bugs in groupby:
DataFrameGroupBy.agg()
would fail when there are multiple groupings, unobserved groups, andas_index=False
(GH 36698)DataFrameGroupBy.groups()
withsort=False
would sort groups; they now occur in the order they are observed (GH 56966)DataFrameGroupBy.nunique()
would fail when there are multiple groupings, unobserved groups, andas_index=False
(GH 52848)DataFrameGroupBy.sum()
would have incorrect values when there are multiple groupings, unobserved groups, and non-numeric data (GH 43891)DataFrameGroupBy.value_counts()
would produce incorrect results when used with some categorical and some non-categorical groupings andobserved=False
(GH 56016)
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 |
---|---|---|---|
numpy |
1.23.5 |
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 |
New Minimum Version |
---|---|
fastparquet |
2023.10.0 |
adbc-driver-postgresql |
0.10.0 |
mypy (dev) |
1.9.0 |
See Dependencies and Optional dependencies for more.
Other API changes#
3rd party
py.path
objects are no longer explicitly supported in IO methods. Usepathlib.Path
objects instead (GH 57091)read_table()
’sparse_dates
argument defaults toNone
to improve consistency withread_csv()
(GH 57476)Made
dtype
a required argument inExtensionArray._from_sequence_of_strings()
(GH 56519)Updated
DataFrame.to_excel()
so that the output spreadsheet has no styling. Custom styling can still be done usingStyler.to_excel()
(GH 54154)pickle and HDF (
.h5
) files created with Python 2 are no longer explicitly supported (GH 57387)pickled objects from pandas version less than
1.0.0
are no longer supported (GH 57155)when comparing the indexes in
testing.assert_series_equal()
, check_exact defaults to True if anIndex
is of integer dtypes. (GH 57386)
Deprecations#
Copy keyword#
The copy
keyword argument in the following methods is deprecated and
will be removed in a future version:
DataFrame.merge()
/pd.merge()
Copy-on-Write utilizes a lazy copy mechanism that defers copying the data until
necessary. Use .copy
to trigger an eager copy. The copy keyword has no effect
starting with 3.0, so it can be safely removed from your code.
Other Deprecations#
Deprecated
Timestamp.utcfromtimestamp()
, useTimestamp.fromtimestamp(ts, "UTC")
instead (GH 56680)Deprecated
Timestamp.utcnow()
, useTimestamp.now("UTC")
instead (GH 56680)Deprecated allowing non-keyword arguments in
DataFrame.all()
,DataFrame.min()
,DataFrame.max()
,DataFrame.sum()
,DataFrame.prod()
,DataFrame.mean()
,DataFrame.median()
,DataFrame.sem()
,DataFrame.var()
,DataFrame.std()
,DataFrame.skew()
,DataFrame.kurt()
,Series.all()
,Series.min()
,Series.max()
,Series.sum()
,Series.prod()
,Series.mean()
,Series.median()
,Series.sem()
,Series.var()
,Series.std()
,Series.skew()
, andSeries.kurt()
. (GH 57087)Deprecated allowing non-keyword arguments in
Series.to_markdown()
exceptbuf
. (GH 57280)Deprecated allowing non-keyword arguments in
Series.to_string()
exceptbuf
. (GH 57280)Deprecated behavior of
Series.dt.to_pytimedelta()
, in a future version this will return aSeries
containing pythondatetime.timedelta
objects instead of anndarray
of timedelta; this matches the behavior of otherSeries.dt()
properties. (GH 57463)Deprecated using
epoch
date format inDataFrame.to_json()
andSeries.to_json()
, useiso
instead. (GH 57063)
Removal of prior version deprecations/changes#
DataFrameGroupBy.idxmin
,DataFrameGroupBy.idxmax
,SeriesGroupBy.idxmin
, andSeriesGroupBy.idxmax
will now raise aValueError
when used withskipna=False
and an NA value is encountered (GH 10694)concat()
no longer ignores empty objects when determining output dtypes (GH 39122)concat()
with all-NA entries no longer ignores the dtype of those entries when determining the result dtype (GH 40893)read_excel()
,read_json()
,read_html()
, andread_xml()
no longer accept raw string or byte representation of the data. That type of data must be wrapped in aStringIO
orBytesIO
(GH 53767)to_datetime()
with aunit
specified no longer parses strings into floats, instead parses them the same way as withoutunit
(GH 50735)DataFrame.groupby()
withas_index=False
and aggregation methods will no longer exclude from the result the groupings that do not arise from the input (GH 49519)Series.dt.to_pydatetime()
now returns aSeries
ofdatetime.datetime
objects (GH 52459)SeriesGroupBy.agg()
no longer pins the name of the group to the input passed to the providedfunc
(GH 51703)All arguments except
name
inIndex.rename()
are now keyword only (GH 56493)All arguments except the first
path
-like argument in IO writers are now keyword only (GH 54229)Disallow allowing logical operations (
||
,&
,^
) between pandas objects and dtype-less sequences (e.g.list
,tuple
); wrap the objects inSeries
,Index
, ornp.array
first instead (GH 52264)Disallow automatic casting to object in
Series
logical operations (&
,^
,||
) between series with mismatched indexes and dtypes other thanobject
orbool
(GH 52538)Disallow calling
Series.replace()
orDataFrame.replace()
without avalue
and with non-dict-liketo_replace
(GH 33302)Disallow constructing a
arrays.SparseArray
with scalar data (GH 53039)Disallow indexing an
Index
with a boolean indexer of length zero, it now raisesValueError
(GH 55820)Disallow non-standard (
np.ndarray
,Index
,ExtensionArray
, orSeries
) toisin()
,unique()
,factorize()
(GH 52986)Disallow passing a pandas type to
Index.view()
(GH 55709)Disallow units other than “s”, “ms”, “us”, “ns” for datetime64 and timedelta64 dtypes in
array()
(GH 53817)Removed “freq” keyword from
PeriodArray
constructor, use “dtype” instead (GH 52462)Removed ‘fastpath’ keyword in
Categorical
constructor (GH 20110)Removed ‘kind’ keyword in
Series.resample()
andDataFrame.resample()
(GH 58125)Removed alias
arrays.PandasArray
forarrays.NumpyExtensionArray
(GH 53694)Removed deprecated “method” and “limit” keywords from
Series.replace()
andDataFrame.replace()
(GH 53492)Removed extension test classes
BaseNoReduceTests
,BaseNumericReduceTests
,BaseBooleanReduceTests
(GH 54663)Removed the “closed” and “normalize” keywords in
DatetimeIndex.__new__()
(GH 52628)Require
SparseDtype.fill_value()
to be a valid value for theSparseDtype.subtype()
(GH 53043)Stopped performing dtype inference with in
Index.insert()
with object-dtype index; this often affects the index/columns that result when setting new entries into an emptySeries
orDataFrame
(GH 51363)Removed the “closed” and “unit” keywords in
TimedeltaIndex.__new__()
(GH 52628, GH 55499)All arguments in
Index.sort_values()
are now keyword only (GH 56493)All arguments in
Series.to_dict()
are now keyword only (GH 56493)Changed the default value of
observed
inDataFrame.groupby()
andSeries.groupby()
toTrue
(GH 51811)Enforce deprecation in
testing.assert_series_equal()
andtesting.assert_frame_equal()
with object dtype and mismatched null-like values, which are now considered not-equal (GH 18463)Enforced deprecation
all
andany
reductions withdatetime64
,DatetimeTZDtype
, andPeriodDtype
dtypes (GH 58029)Enforced deprecation disallowing
float
“periods” indate_range()
,period_range()
,timedelta_range()
,interval_range()
, (GH 56036)Enforced deprecation disallowing parsing datetimes with mixed time zones unless user passes
utc=True
toto_datetime()
(GH 57275)Enforced deprecation in
Series.value_counts()
andIndex.value_counts()
with object dtype performing dtype inference on the.index
of the result (GH 56161)Enforced deprecation of
DataFrameGroupBy.get_group()
andSeriesGroupBy.get_group()
allowing thename
argument to be a non-tuple when grouping by a list of length 1 (GH 54155)Enforced deprecation of
Series.interpolate()
andDataFrame.interpolate()
for object-dtype (GH 57820)Enforced deprecation of
offsets.Tick.delta()
, usepd.Timedelta(obj)
instead (GH 55498)Enforced deprecation of
axis=None
acting the same asaxis=0
in the DataFrame reductionssum
,prod
,std
,var
, andsem
, passingaxis=None
will now reduce over both axes; this is particularly the case when doing e.g.numpy.sum(df)
(GH 21597)Enforced deprecation of non-standard (
np.ndarray
,ExtensionArray
,Index
, orSeries
) argument toapi.extensions.take()
(GH 52981)Enforced deprecation of parsing system timezone strings to
tzlocal
, which depended on system timezone, pass the ‘tz’ keyword instead (GH 50791)Enforced deprecation of passing a dictionary to
SeriesGroupBy.agg()
(GH 52268)Enforced deprecation of string
AS
denoting frequency inYearBegin
and stringsAS-DEC
,AS-JAN
, etc. denoting annual frequencies with various fiscal year starts (GH 57793)Enforced deprecation of string
A
denoting frequency inYearEnd
and stringsA-DEC
,A-JAN
, etc. denoting annual frequencies with various fiscal year ends (GH 57699)Enforced deprecation of string
BAS
denoting frequency inBYearBegin
and stringsBAS-DEC
,BAS-JAN
, etc. denoting annual frequencies with various fiscal year starts (GH 57793)Enforced deprecation of string
BA
denoting frequency inBYearEnd
and stringsBA-DEC
,BA-JAN
, etc. denoting annual frequencies with various fiscal year ends (GH 57793)Enforced deprecation of strings
T
,L
,U
, andN
denoting frequencies inMinute
,Second
,Milli
,Micro
,Nano
(GH 57627)Enforced deprecation of strings
T
,L
,U
, andN
denoting units inTimedelta
(GH 57627)Enforced deprecation of the behavior of
concat()
whenlen(keys) != len(objs)
would truncate to the shorter of the two. Now this raises aValueError
(GH 43485)Enforced deprecation of values “pad”, “ffill”, “bfill”, and “backfill” for
Series.interpolate()
andDataFrame.interpolate()
(GH 57869)Enforced deprecation removing
Categorical.to_list()
, useobj.tolist()
instead (GH 51254)Enforced silent-downcasting deprecation for all relevant methods (GH 54710)
In
DataFrame.stack()
, the default value offuture_stack
is nowTrue
; specifyingFalse
will raise aFutureWarning
(GH 55448)Iterating over a
DataFrameGroupBy
orSeriesGroupBy
will return tuples of length 1 for the groups when grouping bylevel
a list of length 1 (GH 50064)Methods
apply
,agg
, andtransform
will no longer replace NumPy functions (e.g.np.sum
) and built-in functions (e.g.min
) with the equivalent pandas implementation; use string aliases (e.g."sum"
and"min"
) if you desire to use the pandas implementation (GH 53974)Passing both
freq
andfill_value
inDataFrame.shift()
andSeries.shift()
andDataFrameGroupBy.shift()
now raises aValueError
(GH 54818)Removed
DataFrameGroupBy.quantile()
andSeriesGroupBy.quantile()
supporting bool dtype (GH 53975)Removed
DateOffset.is_anchored()
andoffsets.Tick.is_anchored()
(GH 56594)Removed
DataFrame.applymap
,Styler.applymap
andStyler.applymap_index
(GH 52364)Removed
DataFrame.bool
andSeries.bool
(GH 51756)Removed
DataFrame.first
andDataFrame.last
(GH 53710)Removed
DataFrame.swapaxes
andSeries.swapaxes
(GH 51946)Removed
DataFrameGroupBy.grouper
andSeriesGroupBy.grouper
(GH 56521)Removed
DataFrameGroupby.fillna
andSeriesGroupBy.fillna`
(GH 55719)Removed
Index.format
, useIndex.astype()
withstr
orIndex.map()
with aformatter
function instead (GH 55439)Removed
Resample.fillna
(GH 55719)Removed
Series.__int__
andSeries.__float__
. Callint(Series.iloc[0])
orfloat(Series.iloc[0])
instead. (GH 51131)Removed
Series.ravel
(GH 56053)Removed
Series.view
(GH 56054)Removed
StataReader.close
(GH 49228)Removed
_data
fromDataFrame
,Series
,arrays.ArrowExtensionArray
(GH 52003)Removed
axis
argument fromDataFrame.groupby()
,Series.groupby()
,DataFrame.rolling()
,Series.rolling()
,DataFrame.resample()
, andSeries.resample()
(GH 51203)Removed
axis
argument from all groupby operations (GH 50405)Removed
convert_dtype
fromSeries.apply()
(GH 52257)Removed
method
,limit
fill_axis
andbroadcast_axis
keywords fromDataFrame.align()
(GH 51968)Removed
pandas.api.types.is_interval
andpandas.api.types.is_period
, useisinstance(obj, pd.Interval)
andisinstance(obj, pd.Period)
instead (GH 55264)Removed
pandas.io.sql.execute
(GH 50185)Removed
pandas.value_counts
, useSeries.value_counts()
instead (GH 53493)Removed
read_gbq
andDataFrame.to_gbq
. Usepandas_gbq.read_gbq
andpandas_gbq.to_gbq
instead https://pandas-gbq.readthedocs.io/en/latest/api.html (GH 55525)Removed
use_nullable_dtypes
fromread_parquet()
(GH 51853)Removed
year
,month
,quarter
,day
,hour
,minute
, andsecond
keywords in thePeriodIndex
constructor, usePeriodIndex.from_fields()
instead (GH 55960)Removed argument
limit
fromDataFrame.pct_change()
,Series.pct_change()
,DataFrameGroupBy.pct_change()
, andSeriesGroupBy.pct_change()
; the argumentmethod
must be set toNone
and will be removed in a future version of pandas (GH 53520)Removed deprecated argument
obj
inDataFrameGroupBy.get_group()
andSeriesGroupBy.get_group()
(GH 53545)Removed deprecated behavior of
Series.agg()
usingSeries.apply()
(GH 53325)Removed deprecated keyword
method
onSeries.fillna()
,DataFrame.fillna()
(GH 57760)Removed option
mode.use_inf_as_na
, convert inf entries toNaN
before instead (GH 51684)Removed support for
DataFrame
inDataFrame.from_records`(:issue:`51697()
)Removed support for
errors="ignore"
into_datetime()
,to_timedelta()
andto_numeric()
(GH 55734)Removed support for
slice
inDataFrame.take()
(GH 51539)Removed the
ArrayManager
(GH 55043)Removed the
fastpath
argument from theSeries
constructor (GH 55466)Removed the
is_boolean
,is_integer
,is_floating
,holds_integer
,is_numeric
,is_categorical
,is_object
, andis_interval
attributes ofIndex
(GH 50042)Removed the
ordinal
keyword inPeriodIndex
, usePeriodIndex.from_ordinals()
instead (GH 55960)Removed unused arguments
*args
and**kwargs
inResampler
methods (GH 50977)Unrecognized timezones when parsing strings to datetimes now raises a
ValueError
(GH 51477)Removed the
Grouper
attributesax
,groups
,indexer
, andobj
(GH 51206, GH 51182)Removed deprecated keyword
verbose
onread_csv()
andread_table()
(GH 56556)Removed the
method
keyword inExtensionArray.fillna
, implementExtensionArray._pad_or_backfill
instead (GH 53621)Removed the attribute
dtypes
fromDataFrameGroupBy
(GH 51997)Enforced deprecation of
argmin
,argmax
,idxmin
, andidxmax
returning a result whenskipna=False
and an NA value is encountered or all values are NA values; these operations will now raise in such cases (GH 33941, GH 51276)
Performance improvements#
Categorical.categories
returns aRangeIndex
columns instead of anIndex
if the constructedvalues
was arange
. (GH 57787)DataFrame
returns aRangeIndex
columns when possible whendata
is adict
(GH 57943)Series
returns aRangeIndex
index when possible whendata
is adict
(GH 58118)concat()
returns aRangeIndex
column when possible whenobjs
containsSeries
andDataFrame
andaxis=0
(GH 58119)concat()
returns aRangeIndex
level in theMultiIndex
result whenkeys
is arange
orRangeIndex
(GH 57542)RangeIndex.append()
returns aRangeIndex
instead of aIndex
when appending values that could continue theRangeIndex
(GH 57467)Series.str.extract()
returns aRangeIndex
columns instead of anIndex
column when possible (GH 57542)Series.str.partition()
withArrowDtype
returns aRangeIndex
columns instead of anIndex
column when possible (GH 57768)Performance improvement in
DataFrame
whendata
is adict
andcolumns
is specified (GH 24368)Performance improvement in
DataFrame.join()
for sorted but non-unique indexes (GH 56941)Performance improvement in
DataFrame.join()
when left and/or right are non-unique andhow
is"left"
,"right"
, or"inner"
(GH 56817)Performance improvement in
DataFrame.join()
withhow="left"
orhow="right"
andsort=True
(GH 56919)Performance improvement in
DataFrameGroupBy.ffill()
,DataFrameGroupBy.bfill()
,SeriesGroupBy.ffill()
, andSeriesGroupBy.bfill()
(GH 56902)Performance improvement in
Index.join()
by propagating cached attributes in cases where the result matches one of the inputs (GH 57023)Performance improvement in
Index.take()
whenindices
is a full range indexer from zero to length of index (GH 56806)Performance improvement in
Index.to_frame()
returning aRangeIndex
columns of aIndex
when possible. (GH 58018)Performance improvement in
MultiIndex.equals()
for equal length indexes (GH 56990)Performance improvement in
MultiIndex.memory_usage()
to ignore the index engine when it isn’t already cached. (GH 58385)Performance improvement in
RangeIndex.__getitem__()
with a boolean mask or integers returning aRangeIndex
instead of aIndex
when possible. (GH 57588)Performance improvement in
RangeIndex.append()
when appending the same index (GH 57252)Performance improvement in
RangeIndex.argmin()
andRangeIndex.argmax()
(GH 57823)Performance improvement in
RangeIndex.insert()
returning aRangeIndex
instead of aIndex
when theRangeIndex
is empty. (GH 57833)Performance improvement in
RangeIndex.round()
returning aRangeIndex
instead of aIndex
when possible. (GH 57824)Performance improvement in
RangeIndex.join()
returning aRangeIndex
instead of aIndex
when possible. (GH 57651, GH 57752)Performance improvement in
RangeIndex.reindex()
returning aRangeIndex
instead of aIndex
when possible. (GH 57647, GH 57752)Performance improvement in
RangeIndex.take()
returning aRangeIndex
instead of aIndex
when possible. (GH 57445, GH 57752)Performance improvement in
merge()
if hash-join can be used (GH 57970)Performance improvement in
to_hdf()
avoid unnecessary reopenings of the HDF5 file to speedup data addition to files with a very large number of groups . (GH 58248)Performance improvement in
DataFrameGroupBy.__len__
andSeriesGroupBy.__len__
(GH 57595)Performance improvement in indexing operations for string dtypes (GH 56997)
Performance improvement in unary methods on a
RangeIndex
returning aRangeIndex
instead of aIndex
when possible. (GH 57825)
Bug fixes#
Categorical#
Datetimelike#
Bug in
Timestamp
constructor failing to raise whentz=None
is explicitly specified in conjunction with timezone-awaretzinfo
or data (GH 48688)Bug in
date_range()
where the last valid timestamp would sometimes not be produced (GH 56134)Bug in
date_range()
where using a negative frequency value would not include all points between the start and end values (GH 56382)Bug in
tseries.api.guess_datetime_format()
would fail to infer time format when “%Y” == “%H%M” (GH 57452)Bug in setting scalar values with mismatched resolution into arrays with non-nanosecond
datetime64
,timedelta64
orDatetimeTZDtype
incorrectly truncating those scalars (GH 56410)
Timedelta#
Accuracy improvement in
Timedelta.to_pytimedelta()
to round microseconds consistently for large nanosecond based Timedelta (GH 57841)Bug in
DataFrame.cumsum()
which was raisingIndexError
if dtype istimedelta64[ns]
(GH 57956)
Timezones#
Numeric#
Conversion#
Bug in
DataFrame.update()
bool dtype being converted to object (GH 55509)Bug in
Series.astype()
might modify read-only array inplace when casting to a string dtype (GH 57212)Bug in
Series.reindex()
not maintainingfloat32
type when areindex
introduces a missing value (GH 45857)
Strings#
Bug in
Series.value_counts()
would not respectsort=False
for series havingstring
dtype (GH 55224)
Interval#
Bug in
interval_range()
where start and end numeric types were always cast to 64 bit (GH 57268)
Indexing#
Bug in
DataFrame.__getitem__()
returning modified columns when called withslice
in Python 3.12 (GH 57500)
Missing#
MultiIndex#
DataFrame.loc()
withaxis=0
andMultiIndex
when setting a value adds extra columns (GH 58116)
I/O#
Bug in
DataFrame
andSeries
repr
ofcollections.abc.Mapping`
elements. (GH 57915)Bug in
DataFrame.to_dict()
raises unnecessaryUserWarning
when columns are not unique andorient='tight'
. (GH 58281)Bug in
DataFrame.to_excel()
when writing emptyDataFrame
withMultiIndex
on both axes (GH 57696)Bug in
DataFrame.to_string()
that raisedStopIteration
with nested DataFrames. (GH 16098)Bug in
read_csv()
raisingTypeError
whenindex_col
is specified andna_values
is a dict containing the keyNone
. (GH 57547)
Period#
Plotting#
Bug in
DataFrameGroupBy.boxplot()
failed when there were multiple groupings (GH 14701)Bug in
DataFrame.plot()
that causes a shift to the right when the frequency multiplier is greater than one. (GH 57587)
Groupby/resample/rolling#
Bug in
DataFrameGroupBy.groups()
andSeriesGroupby.groups()
that would not respect groupby argumentdropna
(GH 55919)Bug in
DataFrameGroupBy.median()
where nat values gave an incorrect result. (GH 57926)Bug in
DataFrameGroupBy.quantile()
wheninterpolation="nearest"
is inconsistent withDataFrame.quantile()
(GH 47942)Bug in
Resampler.interpolate()
on aDataFrame
with non-uniform sampling and/or indices not aligning with the resulting resampled index would result in wrong interpolation (GH 21351)Bug in
DataFrame.ewm()
andSeries.ewm()
when passedtimes
and aggregation functions other than mean (GH 51695)Bug in
DataFrameGroupBy.apply()
that was returning a completely empty DataFrame when all return values offunc
wereNone
instead of returning an empty DataFrame with the original columns and dtypes. (GH 57775)
Reshaping#
Bug in
DataFrame.join()
inconsistently setting result index name (GH 55815)
Sparse#
Bug in
SparseDtype
for equal comparison with na fill value. (GH 54770)
ExtensionArray#
Bug in
api.types.is_datetime64_any_dtype()
where a customExtensionDtype
would returnFalse
for array-likes (GH 57055)
Styler#
Other#
Bug in
DataFrame
when passing adict
with a NA scalar andcolumns
that would always returnnp.nan
(GH 57205)Bug in
unique()
onIndex
not always returningIndex
(GH 57043)Bug in
DataFrame.eval()
andDataFrame.query()
which caused an exception when using NumPy attributes via@
notation, e.g.,df.eval("@np.floor(a)")
. (GH 58041)Bug in
DataFrame.eval()
andDataFrame.query()
which did not allow to usetan
function. (GH 55091)Bug in
DataFrame.sort_index()
when passingaxis="columns"
andignore_index=True
andascending=False
not returning aRangeIndex
columns (GH 57293)Bug in
DataFrame.transform()
that was returning the wrong order unless the index was monotonically increasing. (GH 57069)Bug in
DataFrame.where()
where using a non-bool type array in the function would return aValueError
instead of aTypeError
(GH 56330)Bug in
Index.sort_values()
when passing a key function that turns values into tuples, e.g.key=natsort.natsort_key
, would raiseTypeError
(GH 56081)Bug in
Series.diff()
allowing non-integer values for theperiods
argument. (GH 56607)Bug in
Series.rank()
that doesn’t preserve missing values for nullable integers whenna_option='keep'
. (GH 56976)Bug in
Series.replace()
andDataFrame.replace()
inconsistently replacing matching instances whenregex=True
and missing values are present. (GH 56599)Bug in Dataframe Interchange Protocol implementation was returning incorrect results for data buffers’ associated dtype, for string and datetime columns (GH 54781)