What’s new in 1.0.2 (March 12, 2020)#
These are the changes in pandas 1.0.2. See Release notes for a full changelog including other versions of pandas.
Fixed regressions#
Groupby
- Fixed regression in - groupby(..).agg()which was failing on frames with- MultiIndexcolumns and a custom function (GH31777)
- Fixed regression in - groupby(..).rolling(..).apply()(- RollingGroupby) where the- rawparameter was ignored (GH31754)
- Fixed regression in - rolling(..).corr()when using a time offset (GH31789)
- Fixed regression in - groupby(..).nunique()which was modifying the original values if- NaNvalues were present (GH31950)
- Fixed regression in - DataFrame.groupbyraising a- ValueErrorfrom an internal operation (GH31802)
- Fixed regression in - groupby(..).agg()calling a user-provided function an extra time on an empty input (GH31760)
I/O
- Fixed regression in - read_csv()in which the- encodingoption was not recognized with certain file-like objects (GH31819)
- Fixed regression in - DataFrame.to_excel()when the- columnskeyword argument is passed (GH31677)
- Fixed regression in - ExcelFilewhere the stream passed into the function was closed by the destructor. (GH31467)
- Fixed regression where - read_pickle()raised a- UnicodeDecodeErrorwhen reading a py27 pickle with- MultiIndexcolumn (GH31988).
Reindexing/alignment
- Fixed regression in - Series.align()when- otheris a- DataFrameand- methodis not- None(GH31785)
- Fixed regression in - DataFrame.reindex()and- Series.reindex()when reindexing with (tz-aware) index and- method=nearest(GH26683)
- Fixed regression in - DataFrame.reindex_like()on a- DataFramesubclass raised an- AssertionError(GH31925)
- Fixed regression in - DataFramearithmetic operations with mis-matched columns (GH31623)
Other
- Fixed regression in joining on - DatetimeIndexor- TimedeltaIndexto preserve- freqin simple cases (GH32166)
- Fixed regression in - Series.shift()with- datetime64dtype when passing an integer- fill_value(GH32591)
- Fixed regression in the repr of an object-dtype - Indexwith bools and missing values (GH32146)
Indexing with nullable boolean arrays#
Previously indexing with a nullable Boolean array containing NA would raise a ValueError, however this is now permitted with NA being treated as False. (GH31503)
In [1]: s = pd.Series([1, 2, 3, 4])
In [2]: mask = pd.array([True, True, False, None], dtype="boolean")
In [3]: s
Out[3]: 
0    1
1    2
2    3
3    4
dtype: int64
In [4]: mask
Out[4]: 
<BooleanArray>
[True, True, False, <NA>]
Length: 4, dtype: boolean
pandas 1.0.0-1.0.1
>>> s[mask]
Traceback (most recent call last):
...
ValueError: cannot mask with array containing NA / NaN values
pandas 1.0.2
In [5]: s[mask]
Out[5]: 
0    1
1    2
dtype: int64
Bug fixes#
Datetimelike
- Bug in - Series.astype()not copying for tz-naive and tz-aware- datetime64dtype (GH32490)
- Bug where - to_datetime()would raise when passed- pd.NA(GH32213)
- Improved error message when subtracting two - Timestampthat result in an out-of-bounds- Timedelta(GH31774)
Categorical
- Fixed bug where - Categorical.from_codes()improperly raised a- ValueErrorwhen passed nullable integer codes. (GH31779)
- Fixed bug where - Categorical()constructor would raise a- TypeErrorwhen given a numpy array containing- pd.NA. (GH31927)
- Bug in - Categoricalthat would ignore or crash when calling- Series.replace()with a list-like- to_replace(GH31720)
I/O
- Using - pd.NAwith- DataFrame.to_json()now correctly outputs a null value instead of an empty object (GH31615)
- Bug in - pandas.json_normalize()when value in meta path is not iterable (GH31507)
- Fixed pickling of - pandas.NA. Previously a new object was returned, which broke computations relying on- NAbeing a singleton (GH31847)
- Fixed bug in parquet roundtrip with nullable unsigned integer dtypes (GH31896). 
Experimental dtypes
- Fixed bug in - DataFrame.convert_dtypes()for columns that were already using the- "string"dtype (GH31731).
- Fixed bug in - DataFrame.convert_dtypes()for series with mix of integers and strings (GH32117)
- Fixed bug in - DataFrame.convert_dtypes()where- BooleanDtypecolumns were converted to- Int64(GH32287)
- Fixed bug in setting values using a slice indexer with string dtype (GH31772) 
- Fixed bug where - pandas.core.groupby.GroupBy.first()and- pandas.core.groupby.GroupBy.last()would raise a- TypeErrorwhen groups contained- pd.NAin a column of object dtype (GH32123)
- Fixed bug where - DataFrameGroupBy.mean(),- DataFrameGroupBy.median(),- DataFrameGroupBy.var(), and- DataFrameGroupBy.std()would raise a- TypeErroron- Int64dtype columns (GH32219)
Strings
- Using - pd.NAwith- Series.str.repeat()now correctly outputs a null value instead of raising error for vector inputs (GH31632)
Rolling
- Fixed rolling operations with variable window (defined by time duration) on decreasing time index (GH32385). 
Contributors#
A total of 25 people contributed patches to this release. People with a “+” by their names contributed a patch for the first time.
- Anna Daglis + 
- Daniel Saxton 
- Irv Lustig 
- Jan Škoda 
- Joris Van den Bossche 
- Justin Zheng 
- Kaiqi Dong 
- Kendall Masse 
- Marco Gorelli 
- Matthew Roeschke 
- MeeseeksMachine 
- MomIsBestFriend 
- Pandas Development Team 
- Pedro Reys + 
- Prakhar Pandey 
- Robert de Vries + 
- Rushabh Vasani 
- Simon Hawkins 
- Stijn Van Hoey 
- Terji Petersen 
- Tom Augspurger 
- William Ayd 
- alimcmaster1 
- gfyoung 
- jbrockmendel