This is a minor bug-fix release in the 0.23.x series and includes some small regression fixes
and bug fixes. We recommend that all users upgrade to this version.
Fixed regressions
Comparing Series with datetime.date
We’ve reverted a 0.23.0 change to comparing a Series holding datetimes and a object ().
In pandas 0.22 and earlier, comparing a Series holding datetimes and objects would coerce the to a datetime before comparing.
This was inconsistent with Python, NumPy, and , which never consider a datetime and equal.
In 0.23.0, we unified operations between DatetimeIndex and Series, and in the process changed comparisons between a Series of datetimes and datetime.date without warning.
We’ve temporarily restored the 0.22.0 behavior, so datetimes and dates may again compare equal, but restore the 0.23.0 behavior in a future release.
To summarize, here’s the behavior in 0.22.0, 0.23.0, 0.23.1:
# 0.22.0... Silently coerce the datetime.date>>>importdatetime>>>pd.Series(pd.date_range('2017',periods=2))==datetime.date(2017,1,1)0True1Falsedtype:bool# 0.23.0... Do not coerce the datetime.date>>>pd.Series(pd.date_range('2017',periods=2))==datetime.date(2017,1,1)0False1Falsedtype:bool# 0.23.1... Coerce the datetime.date with a warning>>>pd.Series(pd.date_range('2017',periods=2))==datetime.date(2017,1,1)/bin/python:1:FutureWarning:ComparingSeriesofdatetimeswith'datetime.date'.Currently,the'datetime.date'iscoercedtoadatetime.Inthefuturepandaswillnotcoerce,andthevaluesnotcompareequaltothe'datetime.date'.Toretainthecurrentbehavior,convertthe'datetime.date'toadatetimewith'pd.Timestamp'.#!/bin/python30True1Falsedtype:bool
In addition, ordering comparisons will raise a TypeError in the future.
Other fixes
Reverted the ability of to_sql() to perform multivalue
inserts as this caused regression in certain cases (GH 21103).
In the future this will be made configurable.
Fixed regression in pandas.io.json.json_normalize() when called with None values
in nested levels in JSON, and to not drop keys with value as None (GH 21158, GH 21356).
Bug in to_csv() causes encoding error when compression and encoding are specified (GH 21241, GH 21118)
Bug preventing pandas from being importable with -OO optimization (GH 21071)
Bug in Categorical.fillna() incorrectly raising a TypeError when value the individual categories are iterable and value is an iterable (GH 21097, GH 19788)
Fixed regression in constructors coercing NA values like None to strings when passing dtype=str (GH 21083)
Regression in pivot_table() where an ordered Categorical with missing
values for the pivot’s index would give a mis-aligned result (GH 21133)
Fixed regression in merging on boolean index/columns (GH 21119).
Performance improvements
Improved performance of CategoricalIndex.is_monotonic_increasing(), CategoricalIndex.is_monotonic_decreasing() and CategoricalIndex.is_monotonic() (GH 21025)
Improved performance of CategoricalIndex.is_unique() (GH 21107)
Bug fixes
Groupby/resample/rolling
Bug in DataFrame.agg() where applying multiple aggregation functions to a DataFrame with duplicated column names would cause a stack overflow (GH 21063)
Bug in GroupBy.ffill() and GroupBy.bfill() where the fill within a grouping would not always be applied as intended due to the implementations’ use of a non-stable sort (GH 21207)
Bug in GroupBy.rank() where results did not scale to 100% when specifying method='dense' and pct=True
Bug in MultiIndex.set_names() where error raised for a MultiIndex with nlevels==1 (GH 21149)
Bug in IntervalIndex constructors where creating an IntervalIndex from categorical data was not fully supported (GH 21243, GH 21253)
Bug in MultiIndex.sort_index() which was not guaranteed to sort correctly with level=1; this was also causing data misalignment in particular DataFrame.stack() operations (GH 20994, GH 20945, GH 21052)