What’s New in 0.24.0 (January 25, 2019)¶
Warning
The 0.24.x series of releases will be the last to support Python 2. Future feature releases will support Python 3 only. See Plan for dropping Python 2.7 for more.
This is a major release from 0.23.4 and includes a number of API changes, new features, enhancements, and performance improvements along with a large number of bug fixes.
Highlights include:
- Optional Integer NA Support
- New APIs for accessing the array backing a Series or Index
- A new top-level method for creating arrays
- Store Interval and Period data in a Series or DataFrame
- Support for joining on two MultiIndexes
Check the API Changes and deprecations before updating.
These are the changes in pandas 0.24.0. See Release Notes for a full changelog including other versions of pandas.
Enhancements¶
Optional Integer NA Support¶
Pandas has gained the ability to hold integer dtypes with missing values. This long requested feature is enabled through the use of extension types.
Note
IntegerArray is currently experimental. Its API or implementation may change without warning.
We can construct a Series
with the specified dtype. The dtype string Int64
is a pandas ExtensionDtype
. Specifying a list or array using the traditional missing value
marker of np.nan
will infer to integer dtype. The display of the Series
will also use the NaN
to indicate missing values in string outputs. (GH20700, GH20747, GH22441, GH21789, GH22346)
In [1]: s = pd.Series([1, 2, np.nan], dtype='Int64')
In [2]: s
Out[2]:
0 1
1 2
2 NaN
Length: 3, dtype: Int64
Operations on these dtypes will propagate NaN
as other pandas operations.
# arithmetic
In [3]: s + 1
Out[3]:
0 2
1 3
2 NaN
Length: 3, dtype: Int64
# comparison
In [4]: s == 1