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
+71-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
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'``.
109
108
110
-
df = pd.DataFrame({'i': ['1','2'],
111
-
'f': ['apple', '4.2'],
112
-
's': ['apple','banana']})
113
-
df
109
+
.. ipython:: python
114
110
115
-
The old usage of ``DataFrame.convert_objects`` used `'coerce'` along with the
116
-
type.
111
+
df = pd.DataFrame({'i': ['1','2'],
112
+
'f': ['apple', '4.2'],
113
+
's': ['apple','banana']})
114
+
df
117
115
118
-
.. code-block:: python
116
+
The old usage of ``DataFrame.convert_objects`` used `'coerce'` along with the
117
+
type.
119
118
120
-
In [2]: df.convert_objects(convert_numeric='coerce')
121
-
122
-
Now the ``coerce`` keyword must be explicitly used.
123
-
124
-
.. ipython:: python
119
+
.. code-block:: python
125
120
126
-
df.convert_objects(numeric=True, coerce=True)
121
+
In [2]: df.convert_objects(convert_numeric='coerce')
127
122
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,
123
+
Now the ``coerce`` keyword must be explicitly used.
130
124
131
-
.. code-block:: python
125
+
.. ipython:: python
132
126
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
127
+
df.convert_objects(numeric=True, coerce=True)
139
128
140
-
returns the original DataFrame with no conversion. This change alters
141
-
this behavior so that
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``.
142
133
143
-
.. ipython:: python
134
+
.. code-block:: python
144
135
145
-
pd.DataFrame({'s': ['a','b']})
146
-
df.convert_objects(numeric=True, coerce=True)
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
147
142
148
-
converts all non-number-like strings to ``NaN``.
143
+
.. ipython:: python
149
144
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.
145
+
pd.DataFrame({'s': ['a','b']})
146
+
df.convert_objects(numeric=True, coerce=True)
154
147
155
-
.. _whatsnew_0170.api_breaking.other:
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.
156
152
157
-
Other API Changes
158
-
^^^^^^^^^^^^^^^^^
153
+
Changes to Index Comparisons
154
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
159
155
160
-
- Operator equal on Index should behavior similarly to Series (:issue:`9947`)
156
+
Operator equal on Index should behavior similarly to Series (:issue:`9947`)
161
157
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``.
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``.
164
160
165
-
Previous behavior:
161
+
Previous behavior:
166
162
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,24 +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
-
- Boolean comparisons of a ``Series`` vs None will now be equivalent to comparing with np.nan, rather than raise ``TypeError``, xref (:issue:`1079`).
233
+
- Boolean comparisons of a ``Series`` vs ``None`` will now be equivalent to comparing with ``np.nan``, rather than raise ``TypeError``, xref (:issue:`1079`).
235
234
- Remove use of some deprecated numpy comparisons (:issue:`10569`)
236
235
237
236
.. _whatsnew_0170.deprecations:
@@ -288,46 +287,48 @@ Bug Fixes
288
287
289
288
- Bug in ``DataFrame.apply`` when function returns categorical series. (:issue:`9573`)
290
289
- Bug in ``to_datetime`` with invalid dates and formats supplied (:issue:`10154`)
291
-
292
290
- Bug in ``Index.drop_duplicates`` dropping name(s) (:issue:`10115`)
293
-
294
-
295
291
- Bug in ``pd.Series`` when setting a value on an empty ``Series`` whose index has a frequency. (:issue:`10193`)
296
-
297
292
- Bug in ``DataFrame.plot`` raises ``ValueError`` when color name is specified by multiple characters (:issue:`10387`)
298
293
- Bug in ``DataFrame.reset_index`` when index contains `NaT`. (:issue:`10388`)
294
+
- Bug in ``ExcelReader`` when worksheet is empty (:issue:`6403`)
295
+
- Bug in ``Table.select_column`` where name is not preserved (:issue:`10392`)
296
+
- Bug in ``offsets.generate_range`` where ``start`` and ``end`` have finer precision than ``offset`` (:issue:`9907`)
299
297
300
298
301
-
- Bug in ``ExcelReader`` when worksheet is empty (:issue:`6403`)
302
299
303
300
304
-
- Bug in ``Table.select_column`` where name is not preserved (:issue:`10392`)
305
-
- Bug in ``offsets.generate_range`` where ``start`` and ``end`` have finer precision than ``offset`` (:issue:`9907`)
306
301
307
302
308
303
- Bug in ``DataFrame.interpolate`` with ``axis=1`` and ``inplace=True`` (:issue:`10395`)
309
-
310
304
- Bug in ``io.sql.get_schema`` when specifying multiple columns as primary
311
305
key (:issue:`10385`).
312
-
313
-
314
306
- Bug in ``test_categorical`` on big-endian builds (:issue:`10425`)
315
307
- Bug in ``Series.map`` using categorical ``Series`` raises ``AttributeError`` (:issue:`10324`)
316
308
- Bug in ``MultiIndex.get_level_values`` including ``Categorical`` raises ``AttributeError`` (:issue:`10460`)
317
309
310
+
311
+
312
+
313
+
314
+
315
+
318
316
- Bug that caused segfault when resampling an empty Series (:issue:`10228`)
319
317
- Bug in ``DatetimeIndex`` and ``PeriodIndex.value_counts`` resets name from its result, but retains in result's ``Index``. (:issue:`10150`)
320
-
321
318
- Bug in `pandas.concat` with ``axis=0`` when column is of dtype ``category`` (:issue:`10177`)
322
-
323
319
- Bug in ``read_msgpack`` where input type is not always checked (:issue:`10369`)
324
-
325
320
- Bug in `pandas.read_csv` with ``index_col=False`` or with ``index_col=['a', 'b']`` (:issue:`10413`, :issue:`10467`)
326
-
327
321
- Bug in `Series.from_csv` with ``header`` kwarg not setting the ``Series.name`` or the ``Series.index.name`` (:issue:`10483`)
328
-
329
322
- Bug in `groupby.var` which caused variance to be inaccurate for small float values (:issue:`10448`)
330
-
331
323
- Bug in ``Series.plot(kind='hist')`` Y Label not informative (:issue:`10485`)
332
324
325
+
326
+
327
+
328
+
329
+
330
+
331
+
332
+
333
+
333
334
- Bug in operator equal on Index not being consistent with Series (:issue:`9947`)
0 commit comments