Skip to content

Commit 0bd25ab

Browse files
committed
DOC: whatsnew changes
1 parent 4def8e4 commit 0bd25ab

File tree

1 file changed

+71
-70
lines changed

1 file changed

+71
-70
lines changed

doc/source/whatsnew/v0.17.0.txt

+71-70
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ New features
3434

3535
Other enhancements
3636
^^^^^^^^^^^^^^^^^^
37+
3738
- Enable `read_hdf` to be used without specifying a key when the HDF file contains a single dataset (:issue:`10443`)
3839

3940
- ``DatetimeIndex`` can be instantiated using strings contains ``NaT`` (:issue:`7599`)
@@ -91,7 +92,7 @@ Backwards incompatible API changes
9192
Changes to convert_objects
9293
^^^^^^^^^^^^^^^^^^^^^^^^^^
9394

94-
- ``DataFrame.convert_objects`` keyword arguments have been shortened. (:issue:`10265`)
95+
``DataFrame.convert_objects`` keyword arguments have been shortened. (:issue:`10265`)
9596

9697
===================== =============
9798
Old New
@@ -101,70 +102,65 @@ Changes to convert_objects
101102
``convert_timedelta`` ``timedelta``
102103
===================== =============
103104

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'``.
109108

110-
df = pd.DataFrame({'i': ['1','2'],
111-
'f': ['apple', '4.2'],
112-
's': ['apple','banana']})
113-
df
109+
.. ipython:: python
114110

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
117115

118-
.. code-block:: python
116+
The old usage of ``DataFrame.convert_objects`` used `'coerce'` along with the
117+
type.
119118

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
125120

126-
df.convert_objects(numeric=True, coerce=True)
121+
In [2]: df.convert_objects(convert_numeric='coerce')
127122

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.
130124

131-
.. code-block:: python
125+
.. ipython:: python
132126

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)
139128

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``.
142133

143-
.. ipython:: python
134+
.. code-block:: python
144135

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
147142

148-
converts all non-number-like strings to ``NaN``.
143+
.. ipython:: python
149144

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)
154147

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.
156152

157-
Other API Changes
158-
^^^^^^^^^^^^^^^^^
153+
Changes to Index Comparisons
154+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
159155

160-
- Operator equal on Index should behavior similarly to Series (:issue:`9947`)
156+
Operator equal on Index should behavior similarly to Series (:issue:`9947`)
161157

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``.
164160

165-
Previous behavior:
161+
Previous behavior:
166162

167-
.. code-block:: python
163+
.. code-block:: python
168164

169165
In [2]: pd.Index([1, 2, 3]) == pd.Index([1, 4, 5])
170166
Out[2]: array([ True, False, False], dtype=bool)
@@ -188,9 +184,9 @@ Other API Changes
188184
In [7]: pd.Series([1, 2, 3]) == pd.Series([1, 2])
189185
ValueError: Series lengths must match to compare
190186

191-
New behavior:
187+
New behavior:
192188

193-
.. code-block:: python
189+
.. code-block:: python
194190

195191
In [8]: pd.Index([1, 2, 3]) == pd.Index([1, 4, 5])
196192
Out[8]: array([ True, False, False], dtype=bool)
@@ -214,24 +210,27 @@ Other API Changes
214210
In [13]: pd.Series([1, 2, 3]) == pd.Series([1, 2])
215211
ValueError: Series lengths must match to compare
216212

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:
219215

220-
.. ipython:: python
216+
.. ipython:: python
221217

222218
np.array([1, 2, 3]) == np.array([1])
223219

224-
or it can return False if broadcasting can not be done:
220+
or it can return False if broadcasting can not be done:
225221

226-
.. ipython:: python
222+
.. ipython:: python
227223

228224
np.array([1, 2, 3]) == np.array([1, 2])
229225

226+
Other API Changes
227+
^^^^^^^^^^^^^^^^^
228+
230229
- Enable writing Excel files in :ref:`memory <_io.excel_writing_buffer>` using StringIO/BytesIO (:issue:`7074`)
231230
- Enable serialization of lists and dicts to strings in ExcelWriter (:issue:`8188`)
232231
- Allow passing `kwargs` to the interpolation methods (:issue:`10378`).
233232
- 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`).
235234
- Remove use of some deprecated numpy comparisons (:issue:`10569`)
236235

237236
.. _whatsnew_0170.deprecations:
@@ -288,46 +287,48 @@ Bug Fixes
288287

289288
- Bug in ``DataFrame.apply`` when function returns categorical series. (:issue:`9573`)
290289
- Bug in ``to_datetime`` with invalid dates and formats supplied (:issue:`10154`)
291-
292290
- Bug in ``Index.drop_duplicates`` dropping name(s) (:issue:`10115`)
293-
294-
295291
- Bug in ``pd.Series`` when setting a value on an empty ``Series`` whose index has a frequency. (:issue:`10193`)
296-
297292
- Bug in ``DataFrame.plot`` raises ``ValueError`` when color name is specified by multiple characters (:issue:`10387`)
298293
- 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`)
299297

300298

301-
- Bug in ``ExcelReader`` when worksheet is empty (:issue:`6403`)
302299

303300

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`)
306301

307302

308303
- Bug in ``DataFrame.interpolate`` with ``axis=1`` and ``inplace=True`` (:issue:`10395`)
309-
310304
- Bug in ``io.sql.get_schema`` when specifying multiple columns as primary
311305
key (:issue:`10385`).
312-
313-
314306
- Bug in ``test_categorical`` on big-endian builds (:issue:`10425`)
315307
- Bug in ``Series.map`` using categorical ``Series`` raises ``AttributeError`` (:issue:`10324`)
316308
- Bug in ``MultiIndex.get_level_values`` including ``Categorical`` raises ``AttributeError`` (:issue:`10460`)
317309

310+
311+
312+
313+
314+
315+
318316
- Bug that caused segfault when resampling an empty Series (:issue:`10228`)
319317
- Bug in ``DatetimeIndex`` and ``PeriodIndex.value_counts`` resets name from its result, but retains in result's ``Index``. (:issue:`10150`)
320-
321318
- Bug in `pandas.concat` with ``axis=0`` when column is of dtype ``category`` (:issue:`10177`)
322-
323319
- Bug in ``read_msgpack`` where input type is not always checked (:issue:`10369`)
324-
325320
- Bug in `pandas.read_csv` with ``index_col=False`` or with ``index_col=['a', 'b']`` (:issue:`10413`, :issue:`10467`)
326-
327321
- Bug in `Series.from_csv` with ``header`` kwarg not setting the ``Series.name`` or the ``Series.index.name`` (:issue:`10483`)
328-
329322
- Bug in `groupby.var` which caused variance to be inaccurate for small float values (:issue:`10448`)
330-
331323
- Bug in ``Series.plot(kind='hist')`` Y Label not informative (:issue:`10485`)
332324

325+
326+
327+
328+
329+
330+
331+
332+
333+
333334
- Bug in operator equal on Index not being consistent with Series (:issue:`9947`)

0 commit comments

Comments
 (0)