You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [15]: pd.Series([np.nan, np.nan, -np.inf, -np.inf]).rank(na_option='top')
60
-
Out[15]:
61
-
0 2.5
62
-
1 2.5
63
-
2 2.5
64
-
3 2.5
65
-
dtype: float64
66
34
67
-
Current Behavior
68
-
69
-
.. code-block:: ipython
70
-
71
-
In [4]: pd.Series([np.nan, np.nan, -np.inf, -np.inf]).rank(na_option='top')
72
-
Out[4]:
73
-
0 1.5
74
-
1 1.5
75
-
2 3.5
76
-
3 3.5
77
-
dtype: float64
78
-
79
-
Moreover, previously if you rank an array of `object` dtype, ``None`` values will have different ranks.
35
+
.. _whatsnew_0220.enhancements.other:
80
36
81
-
Previously Behavior:
37
+
Other Enhancements
38
+
^^^^^^^^^^^^^^^^^^
82
39
83
-
.. code-block:: ipython
40
+
- Better support for :func:`Dataframe.style.to_excel` output with the ``xlsxwriter`` engine. (:issue:`16149`)
41
+
- :func:`pandas.tseries.frequencies.to_offset` now accepts leading '+' signs e.g. '+1h'. (:issue:`18171`)
42
+
- :func:`MultiIndex.unique` now supports the ``level=`` argument, to get unique values from a specific index level (:issue:`17896`)
43
+
- :class:`pandas.io.formats.style.Styler` now has method ``hide_index()`` to determine whether the index will be rendered in ouptut (:issue:`14194`)
44
+
- :class:`pandas.io.formats.style.Styler` now has method ``hide_columns()`` to determine whether columns will be hidden in output (:issue:`14194`)
45
+
- Improved wording of ``ValueError`` raised in :func:`to_datetime` when ``unit=`` is passed with a non-convertible value (:issue:`14350`)
46
+
- :func:`Series.fillna` now accepts a Series or a dict as a ``value`` for a categorical dtype (:issue:`17033`)
47
+
- :func:`pandas.read_clipboard` updated to use qtpy, falling back to PyQt5 and then PyQt4, adding compatibility with Python3 and multiple python-qt bindings (:issue:`17722`)
84
48
85
-
In [3]: pd.Series([None, None, None, 'A','B']).rank(na_option='top')
86
-
Out[3]:
87
-
0 3.0
88
-
1 2.0
89
-
2 1.0
90
-
3 4.0
91
-
4 5.0
92
-
dtype: float64
49
+
.. _whatsnew_0220.api_breaking:
93
50
94
-
Current Behavior
51
+
Backwards incompatible API changes
52
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
95
53
96
-
.. code-block:: ipython
54
+
- :func:`Series.fillna` now raises a ``TypeError`` instead of a ``ValueError`` when passed a list, tuple or DataFrame as a ``value`` (:issue:`18293`)
55
+
- :func:`pandas.DataFrame.merge` no longer casts a ``float`` column to ``object`` when merging on ``int`` and ``float`` columns (:issue:`16572`)
56
+
- The default NA value for :class:`UInt64Index` has changed from 0 to ``NaN``, which impacts methods that mask with NA, such as ``UInt64Index.where()`` (:issue:`18398`)
57
+
-
97
58
98
-
In [3]: pd.Series([None, None, None, 'A','B']).rank(na_option='top')
99
-
Out[3]:
100
-
0 2.0
101
-
1 2.0
102
-
2 2.0
103
-
3 4.0
104
-
4 5.0
105
59
106
-
- Better support for ``Dataframe.style.to_excel()`` output with the ``xlsxwriter`` engine. (:issue:`16149`)
107
-
-
108
-
-
109
60
110
-
.. _whatsnew_0220.api_breaking:
111
61
112
-
Backwards incompatible API changes
113
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
114
62
115
-
-
116
-
-
117
-
-
118
63
119
64
.. _whatsnew_0220.api:
120
65
121
66
Other API Changes
122
67
^^^^^^^^^^^^^^^^^
123
68
69
+
- :func:`Series.astype` and :func:`Index.astype` with an incompatible dtype will now raise a ``TypeError`` rather than a ``ValueError`` (:issue:`18231`)
70
+
- ``Series`` construction with an ``object`` dtyped tz-aware datetime and ``dtype=object`` specified, will now return an ``object`` dtyped ``Series``, previously this would infer the datetime dtype (:issue:`18231`)
124
71
- ``NaT`` division with :class:`datetime.timedelta` will now return ``NaN`` instead of raising (:issue:`17876`)
125
-
- All-NaN levels in ``MultiIndex`` are now assigned float rather than object dtype, coherently with flat indexes (:issue:`17929`).
126
-
- :class:`Timestamp` will no longer silently ignore unused or invalid `tz` or `tzinfo` keyword arguments (:issue:`17690`)
127
-
- :class:`Timestamp` will no longer silently ignore invalid `freq` arguments (:issue:`5168`)
128
-
- :class:`CacheableOffset` and :class:`WeekDay` are no longer available in the `tseries.offsets` module (:issue:`17830`)
72
+
- All-NaN levels in a ``MultiIndex`` are now assigned ``float`` rather than ``object`` dtype, promoting consistency with ``Index`` (:issue:`17929`).
73
+
- :class:`Timestamp` will no longer silently ignore unused or invalid ``tz`` or ``tzinfo`` keyword arguments (:issue:`17690`)
74
+
- :class:`Timestamp` will no longer silently ignore invalid ``freq`` arguments (:issue:`5168`)
75
+
- :class:`CacheableOffset` and :class:`WeekDay` are no longer available in the ``pandas.tseries.offsets`` module (:issue:`17830`)
76
+
- `tseries.frequencies.get_freq_group()` and `tseries.frequencies.DAYS` are removed from the public API (:issue:`18034`)
77
+
- :func:`Series.truncate` and :func:`DataFrame.truncate` will raise a ``ValueError`` if the index is not sorted instead of an unhelpful ``KeyError`` (:issue:`17935`)
78
+
- :func:`Index.map` can now accept ``Series`` and dictionary input objects (:issue:`12756`).
79
+
- :func:`Dataframe.unstack` will now default to filling with ``np.nan`` for ``object`` columns. (:issue:`12815`)
80
+
- :class:`IntervalIndex` constructor will raise if the ``closed`` parameter conflicts with how the input data is inferred to be closed (:issue:`18421`)
81
+
- Inserting missing values into indexes will work for all types of indexes and automatically insert the correct type of missing value (``NaN``, ``NaT``, etc.) regardless of the type passed in (:issue:`18295`)
82
+
- Restricted ``DateOffset`` keyword arguments. Previously, ``DateOffset`` subclasses allowed arbitrary keyword arguments which could lead to unexpected behavior. Now, only valid arguments will be accepted. (:issue:`17176`, :issue:`18226`).
129
83
130
84
.. _whatsnew_0220.deprecations:
131
85
132
86
Deprecations
133
87
~~~~~~~~~~~~
134
88
135
-
-
89
+
- ``Series.from_array`` and ``SparseSeries.from_array`` are deprecated. Use the normal constructor ``Series(..)`` and ``SparseSeries(..)`` instead (:issue:`18213`).
136
90
-
137
91
-
138
92
@@ -141,17 +95,25 @@ Deprecations
141
95
Removal of prior version deprecations/changes
142
96
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
143
97
144
-
-
145
-
-
146
-
-
98
+
- Warnings against the obsolete usage ``Categorical(codes, categories)``, which were emitted for instance when the first two arguments to ``Categorical()`` had different dtypes, and recommended the use of ``Categorical.from_codes``, have now been removed (:issue:`8074`)
99
+
- The ``levels`` and ``labels`` attributes of a ``MultiIndex`` can no longer be set directly (:issue:`4039`).
100
+
- ``pd.tseries.util.pivot_annual`` has been removed (deprecated since v0.19). Use ``pivot_table`` instead (:issue:`18370`)
101
+
- ``pd.tseries.util.isleapyear`` has been removed (deprecated since v0.19). Use ``.is_leap_year`` property in Datetime-likes instead (:issue:`18370`)
102
+
- ``pd.ordered_merge`` has been removed (deprecated since v0.19). Use ``pd..merge_ordered`` instead (:issue:`18459`)
147
103
148
104
.. _whatsnew_0220.performance:
149
105
150
106
Performance Improvements
151
107
~~~~~~~~~~~~~~~~~~~~~~~~
152
108
153
-
- Indexers on Series or DataFrame no longer create a reference cycle (:issue:`17956`)
154
-
-
109
+
- Indexers on ``Series`` or ``DataFrame`` no longer create a reference cycle (:issue:`17956`)
110
+
- Added a keyword argument, ``cache``, to :func:`to_datetime` that improved the performance of converting duplicate datetime arguments (:issue:`11665`)
111
+
- :class`DateOffset` arithmetic performance is improved (:issue:`18218`)
112
+
- Converting a ``Series`` of ``Timedelta`` objects to days, seconds, etc... sped up through vectorization of underlying methods (:issue:`18092`)
113
+
- Improved performance of ``.map()`` with a ``Series/dict`` input (:issue:`15081`)
114
+
- The overriden ``Timedelta`` properties of days, seconds and microseconds have been removed, leveraging their built-in Python versions instead (:issue:`18242`)
115
+
- ``Series`` construction will reduce the number of copies made of the input data in certain cases (:issue:`17449`)
116
+
- Improved performance of :func:`Series.dt.date` and :func:`DatetimeIndex.date` (:issue:`18058`)
155
117
-
156
118
157
119
.. _whatsnew_0220.docs:
@@ -168,27 +130,31 @@ Documentation Changes
168
130
Bug Fixes
169
131
~~~~~~~~~
170
132
171
-
- Bug in ``pd.read_msgpack()`` with a non existent file is passed in Python 2 (:issue:`15296`)
172
-
- Bug in ``DataFrame.groupby`` where key as tuple in a ``MultiIndex`` were interpreted as a list of keys (:issue:`17979`)
173
133
174
134
Conversion
175
135
^^^^^^^^^^
176
136
177
-
-
137
+
- Bug in :class:`Index` constructor with `dtype='uint64'` where int-like floats were not coerced to :class:`UInt64Index` (:issue:`18400`)
178
138
-
179
139
-
180
140
181
141
Indexing
182
142
^^^^^^^^
183
143
184
-
- Bug in :func:`PeriodIndex.truncate` which raises ``TypeError`` when ``PeriodIndex`` is monotonic (:issue:`17717`)
185
-
-
144
+
- Bug in :func:`Series.truncate` which raises ``TypeError`` with a monotonic ``PeriodIndex`` (:issue:`17717`)
145
+
- Bug in :func:`DataFrame.groupby` where tuples were interpreted as lists of keys rather than as keys (:issue:`17979`, :issue:`18249`)
146
+
- Bug in :func:`MultiIndex.remove_unused_levels`` which would fill nan values (:issue:`18417`)
147
+
- Bug in :func:`MultiIndex.from_tuples`` which would fail to take zipped tuples in python3 (:issue:`18434`)
148
+
- Bug in :class:`IntervalIndex` where empty and purely NA data was constructed inconsistently depending on the construction method (:issue:`18421`)
186
149
-
187
150
188
151
I/O
189
152
^^^
190
153
191
154
- :func:`read_html` now rewinds seekable IO objects after parse failure, before attempting to parse with a new parser. If a parser errors and the object is non-seekable, an informative error is raised suggesting the use of a different parser (:issue:`17975`)
155
+
- Bug in :func:`read_msgpack` with a non existent file is passed in Python 2 (:issue:`15296`)
156
+
- Bug in :func:`read_csv` where a ``MultiIndex`` with duplicate columns was not being mangled appropriately (:issue:`18062`)
157
+
- Bug in :func:`read_sas` where a file with 0 variables gave an ``AttributeError`` incorrectly. Now it gives an ``EmptyDataError`` (:issue:`18184`)
192
158
-
193
159
-
194
160
@@ -223,7 +189,7 @@ Reshaping
223
189
Numeric
224
190
^^^^^^^
225
191
226
-
- Bug in ``pd.Series.rank()`` and ``pd.DataFrame.rank() could not properly rank infinit values. Infinit values were assigned NaNs as ranks. If NaNs were present together with infinit values, the ranks were calculated wrong (:issue:`6945`)
192
+
-
227
193
-
228
194
-
229
195
@@ -237,6 +203,6 @@ Categorical
237
203
Other
238
204
^^^^^
239
205
240
-
-
241
-
-
206
+
- Improved error message when attempting to use a Python keyword as an identifier in a numexpr query (:issue:`18221`)
207
+
- Fixed a bug where creating a Series from an array that contains both tz-naive and tz-aware values will result in a Series whose dtype is tz-aware instead of object (:issue:`16406`)
0 commit comments