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 (GH 52445)
Fixed regression in
SeriesGroupBy.agg()failing when grouping with categorical data, multiple groupings,as_index=False, and a list of aggregations (GH 52760)Fixed regression in
DataFrame.pivot()changingIndexname of input object (GH 52629)Fixed regression in
DataFrame.resample()raising on a DataFrame with no columns (GH 52484)Fixed regression in
DataFrame.sort_values()not resetting index whenDataFrameis already sorted andignore_index=True(GH 52553)Fixed regression in
MultiIndex.isin()raisingTypeErrorforGenerator(GH 52568)Fixed regression in
Series.describe()showingRuntimeWarningfor extension dtypeSerieswith one element (GH 52515)Fixed regression when adding a new column to a
DataFramewhen theDataFrame.columnswas aRangeIndexand the new key was hashable but not a scalar (GH 52652)
Bug fixes#
Bug in
Series.dt.daysthat would overflowint32number of days (GH 52391)Bug in
arrays.DatetimeArrayconstructor returning an incorrect unit when passed a non-nanosecond numpy datetime array (GH 52555)Bug in
ArrowExtensionArraywith duration dtype overflowing when constructed from data containing numpyNaT(GH 52843)Bug in
Series.dt.round()when passing afreqof equal or higher resolution compared to theSerieswould raise aZeroDivisionError(GH 52761)Bug in
Series.median()withArrowDtypereturning an approximate median (GH 52679)Bug in
api.interchange.from_dataframe()was unnecessarily raising on categorical dtypes (GH 49889)Bug in
api.interchange.from_dataframe()was unnecessarily raising on large string dtypes (GH 52795)Bug in
pandas.testing.assert_series_equal()wherecheck_dtype=Falsewould still raise for datetime or timedelta types with different resolutions (GH 52449)Bug in
read_csv()casting PyArrow datetimes to NumPy whendtype_backend="pyarrow"andparse_datesis set causing a performance bottleneck in the process (GH 52546)Bug in
to_datetime()andto_timedelta()when trying to convert numeric data with aArrowDtype(GH 52425)Bug in
to_numeric()witherrors='coerce'anddtype_backend='pyarrow'withArrowDtypedata (GH 52588)Bug in
ArrowDtype.__from_arrow__()not respecting if dtype is explicitly given (GH 52533)Bug in
DataFrame.describe()not respectingArrowDtypeinincludeandexclude(GH 52570)Bug in
DataFrame.max()and related casting differentTimestampresolutions always to nanoseconds (GH 52524)Bug in
Series.describe()not returningArrowDtypewithpyarrow.float64type with numeric data (GH 52427)Bug in
Series.dt.tz_localize()incorrectly localizing timestamps withArrowDtype(GH 52677)Bug in arithmetic between
np.datetime64andnp.timedelta64NaTscalars with units always returning nanosecond resolution (GH 52295)Bug in logical and comparison operations between
ArrowDtypeand numpy masked types (e.g."boolean") (GH 52625)Fixed bug in
merge()when merging withArrowDtypeone one and a NumPy dtype on the other side (GH 52406)Fixed segfault in
Series.to_numpy()withnull[pyarrow]dtype (GH 52443)
Other#
DataFramecreated from empty dicts hadcolumnsof dtypeobject. It is now aRangeIndex(GH 52404)Seriescreated from empty dicts hadindexof dtypeobject. It is now aRangeIndex(GH 52404)Implemented
Series.str.split()andSeries.str.rsplit()forArrowDtypewithpyarrow.string(GH 52401)Implemented most
straccessor methods forArrowDtypewithpyarrow.string(GH 52401)Supplying a non-integer hashable key that tests
Falseinapi.types.is_scalar()now raises aKeyErrorforRangeIndex.get_loc(), like it does forIndex.get_loc(). Previously it raised anInvalidIndexError(GH 52652).
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