What’s new in 2.0.1 (April 24, 2023)#
These are the changes in pandas 2.0.1. See Release notes for a full changelog including other versions of pandas.
Fixed regressions#
Fixed regression for subclassed Series when constructing from a dictionary (GH52445)
Fixed regression in
SeriesGroupBy.agg()
failing when grouping with categorical data, multiple groupings,as_index=False
, and a list of aggregations (GH52760)Fixed regression in
DataFrame.pivot()
changingIndex
name of input object (GH52629)Fixed regression in
DataFrame.resample()
raising on a DataFrame with no columns (GH52484)Fixed regression in
DataFrame.sort_values()
not resetting index whenDataFrame
is already sorted andignore_index=True
(GH52553)Fixed regression in
MultiIndex.isin()
raisingTypeError
forGenerator
(GH52568)Fixed regression in
Series.describe()
showingRuntimeWarning
for extension dtypeSeries
with one element (GH52515)Fixed regression when adding a new column to a
DataFrame
when theDataFrame.columns
was aRangeIndex
and the new key was hashable but not a scalar (GH52652)
Bug fixes#
Bug in
Series.dt.days
that would overflowint32
number of days (GH52391)Bug in
arrays.DatetimeArray
constructor returning an incorrect unit when passed a non-nanosecond numpy datetime array (GH52555)Bug in
ArrowExtensionArray
with duration dtype overflowing when constructed from data containing numpyNaT
(GH52843)Bug in
Series.dt.round()
when passing afreq
of equal or higher resolution compared to theSeries
would raise aZeroDivisionError
(GH52761)Bug in
Series.median()
withArrowDtype
returning an approximate median (GH52679)Bug in
api.interchange.from_dataframe()
was unnecessarily raising on categorical dtypes (GH49889)Bug in
api.interchange.from_dataframe()
was unnecessarily raising on large string dtypes (GH52795)Bug in
pandas.testing.assert_series_equal()
wherecheck_dtype=False
would still raise for datetime or timedelta types with different resolutions (GH52449)Bug in
read_csv()
casting PyArrow datetimes to NumPy whendtype_backend="pyarrow"
andparse_dates
is set causing a performance bottleneck in the process (GH52546)Bug in
to_datetime()
andto_timedelta()
when trying to convert numeric data with aArrowDtype
(GH52425)Bug in
to_numeric()
witherrors='coerce'
anddtype_backend='pyarrow'
withArrowDtype
data (GH52588)Bug in
ArrowDtype.__from_arrow__()
not respecting if dtype is explicitly given (GH52533)Bug in
DataFrame.describe()
not respectingArrowDtype
ininclude
andexclude
(GH52570)Bug in
DataFrame.max()
and related casting differentTimestamp
resolutions always to nanoseconds (GH52524)Bug in
Series.describe()
not returningArrowDtype
withpyarrow.float64
type with numeric data (GH52427)Bug in
Series.dt.tz_localize()
incorrectly localizing timestamps withArrowDtype
(GH52677)Bug in arithmetic between
np.datetime64
andnp.timedelta64
NaT
scalars with units always returning nanosecond resolution (GH52295)Bug in logical and comparison operations between
ArrowDtype
and numpy masked types (e.g."boolean"
) (GH52625)Fixed bug in
merge()
when merging withArrowDtype
one one and a NumPy dtype on the other side (GH52406)Fixed segfault in
Series.to_numpy()
withnull[pyarrow]
dtype (GH52443)
Other#
DataFrame
created from empty dicts hadcolumns
of dtypeobject
. It is now aRangeIndex
(GH52404)Series
created from empty dicts hadindex
of dtypeobject
. It is now aRangeIndex
(GH52404)Implemented
Series.str.split()
andSeries.str.rsplit()
forArrowDtype
withpyarrow.string
(GH52401)Implemented most
str
accessor methods forArrowDtype
withpyarrow.string
(GH52401)Supplying a non-integer hashable key that tests
False
inapi.types.is_scalar()
now raises aKeyError
forRangeIndex.get_loc()
, like it does forIndex.get_loc()
. Previously it raised anInvalidIndexError
(GH52652).
Contributors#
A total of 20 people contributed patches to this release. People with a “+” by their names contributed a patch for the first time.
Alex Malins +
Chris Carini +
Dea María Léon
Joris Van den Bossche
Luke Manley
Marc Garcia
Marco Edward Gorelli
MarcoGorelli
Matthew Roeschke
MeeseeksMachine
Natalia Mokeeva
Nirav +
Pandas Development Team
Patrick Hoefler
Richard Shadrach
Stefanie Molin
Terji Petersen
Thomas +
Thomas Li
yonashub