What’s New in 0.23.1 (June 12, 2018)

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.

Warning

Starting January 1, 2019, pandas feature releases will support Python 3 only. See Plan for dropping Python 2.7 for more.

Fixed Regressions

Comparing Series with datetime.date

We’ve reverted a 0.23.0 change to comparing a Series holding datetimes and a datetime.date object (GH21152). In pandas 0.22 and earlier, comparing a Series holding datetimes and datetime.date objects would coerce the datetime.date to a datetime before comapring. This was inconsistent with Python, NumPy, and DatetimeIndex, which never consider a datetime and datetime.date 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
>>> Series(pd.date_range('2017', periods=2)) == datetime.date(2017, 1, 1)
0     True
1    False
dtype: bool

# 0.23.0... Do not coerce the datetime.date
>>> Series(pd.date_range('2017', periods=2)) == datetime.date(2017, 1, 1)
0    False
1    False
dtype: bool

# 0.23.1... Coerce the datetime.date with a warning
>>> Series(pd.date_range('2017', periods=2)) == datetime.date(2017, 1, 1)
/bin/python:1: FutureWarning: Comparing Series of datetimes with 'datetime.date'.  Currently, the
'datetime.date' is coerced to a datetime. In the future pandas will
not coerce, and the values not compare equal to the 'datetime.date'.
To retain the current behavior, convert the 'datetime.date' to a
datetime with 'pd.Timestamp'.
  #!/bin/python3
0     True
1    False
dtype: 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 (GH21103). In the future this will be made configurable.
  • Fixed regression in the DatetimeIndex.date and DatetimeIndex.time attributes in case of timezone-aware data: DatetimeIndex.time returned a tz-aware time instead of tz-naive (GH21267) and DatetimeIndex.date returned incorrect date when the input date has a non-UTC timezone (GH21230).
  • 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 (GH21158, GH21356).
  • Bug in to_csv() causes encoding error when compression and encoding are specified (GH21241, GH21118)
  • Bug preventing pandas from being importable with -OO optimization (GH21071)
  • Bug in Categorical.fillna() incorrectly raising a TypeError when value the individual categories are iterable and value is an iterable (GH21097, GH19788)
  • Fixed regression in constructors coercing NA values like None to strings when passing dtype=str (GH21083)
  • Regression in pivot_table() where an ordered Categorical with missing values for the pivot’s index would give a mis-aligned result (GH21133)
  • Fixed regression in merging on boolean index/columns (GH21119).

Performance Improvements

  • Improved performance of CategoricalIndex.is_monotonic_increasing(), CategoricalIndex.is_monotonic_decreasing() and CategoricalIndex.is_monotonic() (GH21025)
  • Improved performance of CategoricalIndex.is_unique() (GH21107)

Bug Fixes

Groupby/Resample/Rolling

Data-type specific

Sparse

  • Bug in SparseArray.shape which previously only returned the shape SparseArray.sp_values (GH21126)

Indexing

  • Bug in Series.reset_index() where appropriate error was not raised with an invalid level name (GH20925)
  • Bug in interval_range() when start/periods or end/periods are specified with float start or end (GH21161)
  • Bug in MultiIndex.set_names() where error raised for a MultiIndex with nlevels == 1 (GH21149)
  • Bug in IntervalIndex constructors where creating an IntervalIndex from categorical data was not fully supported (GH21243, GH21253)
  • 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 (GH20994, GH20945, GH21052)

Plotting

  • New keywords (sharex, sharey) to turn on/off sharing of x/y-axis by subplots generated with pandas.DataFrame().groupby().boxplot() (GH20968)

I/O

  • Bug in IO methods specifying compression='zip' which produced uncompressed zip archives (GH17778, GH21144)
  • Bug in DataFrame.to_stata() which prevented exporting DataFrames to buffers and most file-like objects (GH21041)
  • Bug in read_stata() and StataReader which did not correctly decode utf-8 strings on Python 3 from Stata 14 files (dta version 118) (GH21244)
  • Bug in IO JSON read_json() reading empty JSON schema with orient='table' back to DataFrame caused an error (GH21287)

Reshaping

  • Bug in concat() where error was raised in concatenating Series with numpy scalar and tuple names (GH21015)
  • Bug in concat() warning message providing the wrong guidance for future behavior (GH21101)

Other

  • Tab completion on Index in IPython no longer outputs deprecation warnings (GH21125)
  • Bug preventing pandas being used on Windows without C++ redistributable installed (GH21106)

Contributors

Scroll To Top