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
Copy file name to clipboardExpand all lines: doc/source/whatsnew/v0.17.0.txt
+73-70
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,7 @@ New features
34
34
35
35
Other enhancements
36
36
^^^^^^^^^^^^^^^^^^
37
+
37
38
- Enable `read_hdf` to be used without specifying a key when the HDF file contains a single dataset (:issue:`10443`)
38
39
39
40
- ``DatetimeIndex`` can be instantiated using strings contains ``NaT`` (:issue:`7599`)
@@ -91,7 +92,7 @@ Backwards incompatible API changes
91
92
Changes to convert_objects
92
93
^^^^^^^^^^^^^^^^^^^^^^^^^^
93
94
94
-
- ``DataFrame.convert_objects`` keyword arguments have been shortened. (:issue:`10265`)
95
+
``DataFrame.convert_objects`` keyword arguments have been shortened. (:issue:`10265`)
95
96
96
97
===================== =============
97
98
Old New
@@ -101,70 +102,65 @@ Changes to convert_objects
101
102
``convert_timedelta`` ``timedelta``
102
103
===================== =============
103
104
104
-
- Coercing types with ``DataFrame.convert_objects`` is now implemented using the
105
-
keyword argument ``coerce=True``. Previously types were coerced by setting a
106
-
keyword argument to ``'coerce'`` instead of ``True``, as in ``convert_dates='coerce'``.
107
-
108
-
.. ipython:: python
109
-
110
-
df = pd.DataFrame({'i': ['1','2'],
111
-
'f': ['apple', '4.2'],
112
-
's': ['apple','banana']})
113
-
df
105
+
Coercing types with ``DataFrame.convert_objects`` is now implemented using the
106
+
keyword argument ``coerce=True``. Previously types were coerced by setting a
107
+
keyword argument to ``'coerce'`` instead of ``True``, as in ``convert_dates='coerce'``.
114
108
115
-
The old usage of ``DataFrame.convert_objects`` used `'coerce'` along with the
116
-
type.
109
+
.. ipython:: python
117
110
118
-
.. code-block:: python
111
+
df = pd.DataFrame({'i': ['1','2'],
112
+
'f': ['apple', '4.2'],
113
+
's': ['apple','banana']})
114
+
df
119
115
120
-
In [2]: df.convert_objects(convert_numeric='coerce')
116
+
The old usage of ``DataFrame.convert_objects`` used `'coerce'` along with the
117
+
type.
121
118
122
-
Now the ``coerce`` keyword must be explicitly used.
119
+
.. code-block:: python
123
120
124
-
.. ipython:: python
121
+
In [2]: df.convert_objects(convert_numeric='coerce')
125
122
126
-
df.convert_objects(numeric=True, coerce=True)
123
+
Now the ``coerce`` keyword must be explicitly used.
127
124
128
-
- In earlier versions of pandas, ``DataFrame.convert_objects`` would not coerce
129
-
numeric types when there were no values convertible to a numeric type. For example,
125
+
.. ipython:: python
130
126
131
-
.. code-block:: python
127
+
df.convert_objects(numeric=True, coerce=True)
132
128
133
-
In [1]: df = pd.DataFrame({'s': ['a','b']})
134
-
In [2]: df.convert_objects(convert_numeric='coerce')
135
-
Out[2]:
136
-
s
137
-
0 a
138
-
1 b
129
+
In earlier versions of pandas, ``DataFrame.convert_objects`` would not coerce
130
+
numeric types when there were no values convertible to a numeric type. This returns
131
+
the original DataFrame with no conversion. This change alters
132
+
this behavior so that converts all non-number-like strings to ``NaN``.
139
133
140
-
returns the original DataFrame with no conversion. This change alters
141
-
this behavior so that
134
+
.. code-block:: python
142
135
143
-
.. ipython:: python
136
+
In [1]: df = pd.DataFrame({'s': ['a','b']})
137
+
In [2]: df.convert_objects(convert_numeric='coerce')
138
+
Out[2]:
139
+
s
140
+
0 a
141
+
1 b
144
142
145
-
pd.DataFrame({'s': ['a','b']})
146
-
df.convert_objects(numeric=True, coerce=True)
143
+
.. ipython:: python
147
144
148
-
converts all non-number-like strings to ``NaN``.
145
+
pd.DataFrame({'s': ['a','b']})
146
+
df.convert_objects(numeric=True, coerce=True)
149
147
150
-
- In earlier versions of pandas, the default behavior was to try and convert
151
-
datetimes and timestamps. The new default is for ``DataFrame.convert_objects``
152
-
to do nothing, and so it is necessary to pass at least one conversion target
153
-
in the method call.
148
+
In earlier versions of pandas, the default behavior was to try and convert
149
+
datetimes and timestamps. The new default is for ``DataFrame.convert_objects``
150
+
to do nothing, and so it is necessary to pass at least one conversion target
151
+
in the method call.
154
152
155
-
.. _whatsnew_0170.api_breaking.other:
153
+
Changes to Index Comparisons
154
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
156
155
157
-
Other API Changes
158
-
^^^^^^^^^^^^^^^^^
156
+
Operator equal on Index should behavior similarly to Series (:issue:`9947`)
159
157
160
-
- Operator equal on Index should behavior similarly to Series (:issue:`9947`)
158
+
Starting in v0.17.0, comparing ``Index`` objects of different lengths will raise
159
+
a ``ValueError``. This is to be consistent with the behavior of ``Series``.
161
160
162
-
Starting in v0.17.0, comparing ``Index`` objects of different lengths will raise
163
-
a ``ValueError``. This is to be consistent with the behavior of ``Series``.
161
+
Previous behavior:
164
162
165
-
Previous behavior:
166
-
167
-
.. code-block:: python
163
+
.. code-block:: python
168
164
169
165
In [2]: pd.Index([1, 2, 3]) == pd.Index([1, 4, 5])
170
166
Out[2]: array([ True, False, False], dtype=bool)
@@ -188,9 +184,9 @@ Other API Changes
188
184
In [7]: pd.Series([1, 2, 3]) == pd.Series([1, 2])
189
185
ValueError: Series lengths must match to compare
190
186
191
-
New behavior:
187
+
New behavior:
192
188
193
-
.. code-block:: python
189
+
.. code-block:: python
194
190
195
191
In [8]: pd.Index([1, 2, 3]) == pd.Index([1, 4, 5])
196
192
Out[8]: array([ True, False, False], dtype=bool)
@@ -214,25 +210,27 @@ Other API Changes
214
210
In [13]: pd.Series([1, 2, 3]) == pd.Series([1, 2])
215
211
ValueError: Series lengths must match to compare
216
212
217
-
Note that this is different from the ``numpy`` behavior where a comparison can
218
-
be broadcast:
213
+
Note that this is different from the ``numpy`` behavior where a comparison can
214
+
be broadcast:
219
215
220
-
.. ipython:: python
216
+
.. ipython:: python
221
217
222
218
np.array([1, 2, 3]) == np.array([1])
223
219
224
-
or it can return False if broadcasting can not be done:
220
+
or it can return False if broadcasting can not be done:
225
221
226
-
.. ipython:: python
222
+
.. ipython:: python
227
223
228
224
np.array([1, 2, 3]) == np.array([1, 2])
229
225
226
+
Other API Changes
227
+
^^^^^^^^^^^^^^^^^
228
+
230
229
- Enable writing Excel files in :ref:`memory <_io.excel_writing_buffer>` using StringIO/BytesIO (:issue:`7074`)
231
230
- Enable serialization of lists and dicts to strings in ExcelWriter (:issue:`8188`)
232
231
- Allow passing `kwargs` to the interpolation methods (:issue:`10378`).
233
232
- Serialize metadata properties of subclasses of pandas objects (:issue:`10553`).
234
233
235
-
236
234
.. _whatsnew_0170.deprecations:
237
235
238
236
Deprecations
@@ -243,6 +241,8 @@ Deprecations
243
241
Removal of prior version deprecations/changes
244
242
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
245
243
244
+
- Remove use of some deprecated numpy comparison operations, mainly in tests. (:issue:`10569`)
245
+
246
246
.. _dask: https://dask.readthedocs.org/en/latest/
247
247
248
248
.. _whatsnew_0170.gil:
@@ -285,48 +285,51 @@ Performance Improvements
285
285
Bug Fixes
286
286
~~~~~~~~~
287
287
288
+
- Boolean comparisons of a ``Series`` vs ``None`` will now be equivalent to comparing with ``np.nan``, rather than raise ``TypeError``, xref (:issue:`1079`).
288
289
- Bug in ``DataFrame.apply`` when function returns categorical series. (:issue:`9573`)
289
290
- Bug in ``to_datetime`` with invalid dates and formats supplied (:issue:`10154`)
290
-
291
291
- Bug in ``Index.drop_duplicates`` dropping name(s) (:issue:`10115`)
292
-
293
-
294
292
- Bug in ``pd.Series`` when setting a value on an empty ``Series`` whose index has a frequency. (:issue:`10193`)
295
-
296
293
- Bug in ``DataFrame.plot`` raises ``ValueError`` when color name is specified by multiple characters (:issue:`10387`)
297
294
- Bug in ``DataFrame.reset_index`` when index contains `NaT`. (:issue:`10388`)
295
+
- Bug in ``ExcelReader`` when worksheet is empty (:issue:`6403`)
296
+
- Bug in ``Table.select_column`` where name is not preserved (:issue:`10392`)
297
+
- Bug in ``offsets.generate_range`` where ``start`` and ``end`` have finer precision than ``offset`` (:issue:`9907`)
298
298
299
299
300
-
- Bug in ``ExcelReader`` when worksheet is empty (:issue:`6403`)
301
300
302
301
303
-
- Bug in ``Table.select_column`` where name is not preserved (:issue:`10392`)
304
-
- Bug in ``offsets.generate_range`` where ``start`` and ``end`` have finer precision than ``offset`` (:issue:`9907`)
305
302
306
303
307
304
- Bug in ``DataFrame.interpolate`` with ``axis=1`` and ``inplace=True`` (:issue:`10395`)
308
-
309
305
- Bug in ``io.sql.get_schema`` when specifying multiple columns as primary
310
306
key (:issue:`10385`).
311
-
312
-
313
307
- Bug in ``test_categorical`` on big-endian builds (:issue:`10425`)
314
308
- Bug in ``Series.map`` using categorical ``Series`` raises ``AttributeError`` (:issue:`10324`)
315
309
- Bug in ``MultiIndex.get_level_values`` including ``Categorical`` raises ``AttributeError`` (:issue:`10460`)
316
310
311
+
312
+
313
+
314
+
315
+
316
+
317
317
- Bug that caused segfault when resampling an empty Series (:issue:`10228`)
318
318
- Bug in ``DatetimeIndex`` and ``PeriodIndex.value_counts`` resets name from its result, but retains in result's ``Index``. (:issue:`10150`)
319
-
320
319
- Bug in `pandas.concat` with ``axis=0`` when column is of dtype ``category`` (:issue:`10177`)
321
-
322
320
- Bug in ``read_msgpack`` where input type is not always checked (:issue:`10369`)
323
-
324
321
- Bug in `pandas.read_csv` with ``index_col=False`` or with ``index_col=['a', 'b']`` (:issue:`10413`, :issue:`10467`)
325
-
326
322
- Bug in `Series.from_csv` with ``header`` kwarg not setting the ``Series.name`` or the ``Series.index.name`` (:issue:`10483`)
327
-
328
323
- Bug in `groupby.var` which caused variance to be inaccurate for small float values (:issue:`10448`)
329
-
330
324
- Bug in ``Series.plot(kind='hist')`` Y Label not informative (:issue:`10485`)
331
325
326
+
327
+
328
+
329
+
330
+
331
+
332
+
333
+
334
+
332
335
- Bug in operator equal on Index not being consistent with Series (:issue:`9947`)
0 commit comments