Skip to content

Commit cba1214

Browse files
committed
DOC: more fixes to 0.16.0.txt
1 parent 6514c41 commit cba1214

File tree

1 file changed

+54
-114
lines changed

1 file changed

+54
-114
lines changed

doc/source/whatsnew/v0.16.0.txt

Lines changed: 54 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -166,18 +166,15 @@ from a ``scipy.sparse.coo_matrix``:
166166

167167
.. _whatsnew_0160.api_breaking:
168168

169-
Backwards incompatible API changes
170-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
171-
172169
.. _whatsnew_0160.api_breaking.timedelta:
173170

174-
Changes in Timedelta
175-
~~~~~~~~~~~~~~~~~~~~
171+
Change in Timedelta
172+
~~~~~~~~~~~~~~~~~~~
176173

177174
In v0.15.0 a new scalar type ``Timedelta`` was introduced, that is a
178175
sub-class of ``datetime.timedelta``. Mentioned :ref:`here <whatsnew_0150.timedeltaindex>` was a notice of an API change w.r.t. the ``.seconds`` accessor. The intent was to provide a user-friendly set of accessors that give the 'natural' value for that unit, e.g. if you had a ``Timedelta('1 day, 10:11:12')``, then ``.seconds`` would return 12. However, this is at odds with the definition of ``datetime.timedelta``, which defines ``.seconds`` as ``10 * 3600 + 11 * 60 + 12 == 36672``.
179176

180-
So in v0.16.0, we are restoring the API to match that of ``datetime.timedelta``. Further, the component values are still available through the ``.components`` accessor. This affects the ``.seconds`` and ``.microseconds`` accessors, and removes the ``.hours``, ``.minutes``, ``.milliseconds`` accessors. These changes affect ``TimedeltaIndex`` and the Series ``.dt`` accessor as well. (:issue:`9185`, :issue:`9139`)
177+
So in v0.16.0, we are restoring the API to match that of ``datetime.timedelta``. Further, the component values are still available through the ``.components`` accessor. This affects the ``.seconds`` and ``.microseconds`` accessors, and removes the ``.hours``, ``.minutes``, ``.milliseconds`` accessors. These changes affect ``TimedeltaIndex`` and the Series ``.dt`` accessor as well. (:issue:`9185`, :issue:`9139`)
181178

182179
Previous Behavior
183180

@@ -219,62 +216,62 @@ The behavior of a small sub-set of edge cases for using ``.loc`` have changed (:
219216

220217
- slicing with ``.loc`` where the start and/or stop bound is not found in the index is now allowed; this previously would raise a ``KeyError``. This makes the behavior the same as ``.ix`` in this case. This change is only for slicing, not when indexing with a single label.
221218

222-
.. ipython:: python
219+
.. ipython:: python
223220

224-
df = DataFrame(np.random.randn(5,4),
225-
columns=list('ABCD'),
226-
index=date_range('20130101',periods=5))
227-
df
228-
s = Series(range(5),[-2,-1,1,2,3])
229-
s
221+
df = DataFrame(np.random.randn(5,4),
222+
columns=list('ABCD'),
223+
index=date_range('20130101',periods=5))
224+
df
225+
s = Series(range(5),[-2,-1,1,2,3])
226+
s
230227

231-
Previous Behavior
228+
Previous Behavior
232229

233-
.. code-block:: python
230+
.. code-block:: python
234231

235-
In [4]: df.loc['2013-01-02':'2013-01-10']
236-
KeyError: 'stop bound [2013-01-10] is not in the [index]'
232+
In [4]: df.loc['2013-01-02':'2013-01-10']
233+
KeyError: 'stop bound [2013-01-10] is not in the [index]'
237234

238-
In [6]: s.loc[-10:3]
239-
KeyError: 'start bound [-10] is not the [index]'
235+
In [6]: s.loc[-10:3]
236+
KeyError: 'start bound [-10] is not the [index]'
240237

241-
New Behavior
238+
New Behavior
242239

243-
.. ipython:: python
240+
.. ipython:: python
244241

245-
df.loc['2013-01-02':'2013-01-10']
246-
s.loc[-10:3]
242+
df.loc['2013-01-02':'2013-01-10']
243+
s.loc[-10:3]
247244

248245
- allow slicing with float-like values on an integer index for ``.ix``. Previously this was only enabled for ``.loc``:
249246

250-
Previous Behavior
247+
Previous Behavior
251248

252-
.. code-block:: python
249+
.. code-block:: python
253250

254-
In [8]: s.ix[-1.0:2]
255-
TypeError: the slice start value [-1.0] is not a proper indexer for this index type (Int64Index)
251+
In [8]: s.ix[-1.0:2]
252+
TypeError: the slice start value [-1.0] is not a proper indexer for this index type (Int64Index)
256253

257-
New Behavior
254+
New Behavior
258255

259-
.. ipython:: python
256+
.. ipython:: python
260257

261-
s.ix[-1.0:2]
258+
s.ix[-1.0:2]
262259

263260
- provide a useful exception for indexing with an invalid type for that index when using ``.loc``. For example trying to use ``.loc`` on an index of type ``DatetimeIndex`` or ``PeriodIndex`` or ``TimedeltaIndex``, with an integer (or a float).
264261

265-
Previous Behavior
262+
Previous Behavior
266263

267-
.. code-block:: python
264+
.. code-block:: python
268265

269-
In [4]: df.loc[2:3]
270-
KeyError: 'start bound [2] is not the [index]'
266+
In [4]: df.loc[2:3]
267+
KeyError: 'start bound [2] is not the [index]'
271268

272-
New Behavior
269+
New Behavior
273270

274-
.. code-block:: python
271+
.. code-block:: python
275272

276-
In [4]: df.loc[2:3]
277-
TypeError: Cannot do slice indexing on <class 'pandas.tseries.index.DatetimeIndex'> with <type 'int'> keys
273+
In [4]: df.loc[2:3]
274+
TypeError: Cannot do slice indexing on <class 'pandas.tseries.index.DatetimeIndex'> with <type 'int'> keys
278275

279276

280277
.. _whatsnew_0160.api:
@@ -306,31 +303,32 @@ API Changes
306303
- Bar and horizontal bar plots no longer add a dashed line along the info axis. The prior style can be achieved with matplotlib's ``axhline`` or ``axvline`` methods (:issue:`9088`).
307304

308305

309-
- ``Series`` now supports bitwise operation for integral types (:issue:`9016`)
306+
- ``Series`` now supports bitwise operation for integral types (:issue:`9016`). Previously even if the input dtypes were integral, the output dtype was coerced to ``bool``.
310307

311-
Previously even if the input dtypes were integral, the output dtype was coerced to ``bool``.
308+
Previous Behavior
312309

313310
.. code-block:: python
314-
In [2]: pd.Series([0,1,2,3], list('abcd')) | pd.Series([4,4,4,4], list('abcd'))
315-
Out[2]:
316-
a True
317-
b True
318-
c True
319-
d True
320-
dtype: bool
321-
322-
Now if the input dtypes are integral, the output dtype is also integral and the output
311+
312+
In [2]: pd.Series([0,1,2,3], list('abcd')) | pd.Series([4,4,4,4], list('abcd'))
313+
Out[2]:
314+
a True
315+
b True
316+
c True
317+
d True
318+
dtype: bool
319+
320+
New Behavior. If the input dtypes are integral, the output dtype is also integral and the output
323321
values are the result of the bitwise operation.
324322

325323
.. code-block:: python
326324

327-
In [2]: pd.Series([0,1,2,3], list('abcd')) | pd.Series([4,4,4,4], list('abcd'))
328-
Out[2]:
329-
a 4
330-
b 5
331-
c 6
332-
d 7
333-
dtype: int64
325+
In [2]: pd.Series([0,1,2,3], list('abcd')) | pd.Series([4,4,4,4], list('abcd'))
326+
Out[2]:
327+
a 4
328+
b 5
329+
c 6
330+
d 7
331+
dtype: int64
334332

335333

336334
- During division involving a ``Series`` or ``DataFrame``, ``0/0`` and ``0//0`` now give ``np.nan`` instead of ``np.inf``. (:issue:`9144`, :issue:`8445`)
@@ -435,23 +433,16 @@ Bug Fixes
435433
SQLAlchemy type (:issue:`9083`).
436434
- Bug in ``.loc`` partial setting with a ``np.datetime64`` (:issue:`9516`)
437435
- Incorrect dtypes inferred on datetimelike looking ``Series`` & on ``.xs`` slices (:issue:`9477`)
438-
439436
- Items in ``Categorical.unique()`` (and ``s.unique()`` if ``s`` is of dtype ``category``) now appear in the order in which they are originally found, not in sorted order (:issue:`9331`). This is now consistent with the behavior for other dtypes in pandas.
440-
441-
442437
- Fixed bug on big endian platforms which produced incorrect results in ``StataReader`` (:issue:`8688`).
443-
444438
- Bug in ``MultiIndex.has_duplicates`` when having many levels causes an indexer overflow (:issue:`9075`, :issue:`5873`)
445439
- Bug in ``pivot`` and ``unstack`` where ``nan`` values would break index alignment (:issue:`4862`, :issue:`7401`, :issue:`7403`, :issue:`7405`, :issue:`7466`, :issue:`9497`)
446440
- Bug in left ``join`` on multi-index with ``sort=True`` or null values (:issue:`9210`).
447441
- Bug in ``MultiIndex`` where inserting new keys would fail (:issue:`9250`).
448442
- Bug in ``groupby`` when key space exceeds ``int64`` bounds (:issue:`9096`).
449443
- Bug in ``unstack`` with ``TimedeltaIndex`` or ``DatetimeIndex`` and nulls (:issue:`9491`).
450444
- Bug in ``rank`` where comparing floats with tolerance will cause inconsistent behaviour (:issue:`8365`).
451-
452-
453445
- Fixed character encoding bug in ``read_stata`` and ``StataReader`` when loading data from a URL (:issue:`9231`).
454-
455446
- Looking up a partial string label with ``DatetimeIndex.asof`` now includes values that match the string, even if they are after the start of the partial string label (:issue:`9258`). Old behavior:
456447

457448
.. ipython:: python
@@ -467,50 +458,12 @@ Bug Fixes
467458
pd.to_datetime(['2000-01-31', '2000-02-28']).asof('2000-02')
468459

469460
To reproduce the old behavior, simply add more precision to the label (e.g., use ``2000-02-01`` instead of ``2000-02``).
470-
471-
472-
473461
- Bug in adding ``offsets.Nano`` to other offets raises ``TypeError`` (:issue:`9284`)
474-
475-
476-
477-
478-
479-
480-
481-
482-
483-
484-
485-
486-
487-
488462
- Bug in ``DatetimeIndex`` iteration, related to (:issue:`8890`), fixed in (:issue:`9100`)
489-
490-
491-
492-
493-
494463
- Bug in binary operator method (eg ``.mul()``) alignment with integer levels (:issue:`9463`).
495-
496-
497-
498-
499-
500-
501-
502464
- Bug in boxplot, scatter and hexbin plot may show an unnecessary warning (:issue:`8877`)
503465
- Bug in subplot with ``layout`` kw may show unnecessary warning (:issue:`9464`)
504-
505-
506-
507-
508-
509-
510-
511-
512466
- Bug in using grouper functions that need passed thru arguments (e.g. axis), when using wrapped function (e.g. ``fillna``), (:issue:`9221`)
513-
514467
- ``DataFrame`` now properly supports simultaneous ``copy`` and ``dtype`` arguments in constructor (:issue:`9099`)
515468
- Bug in ``read_csv`` when using skiprows on a file with CR line endings with the c engine. (:issue:`9079`)
516469
- ``isnull`` now detects ``NaT`` in ``PeriodIndex`` (:issue:`9129`)
@@ -520,29 +473,16 @@ Bug Fixes
520473
- Accessing ``Series.str`` methods on with non-string values now raises ``TypeError`` instead of producing incorrect results (:issue:`9184`)
521474
- Bug in ``DatetimeIndex.__contains__`` when index has duplicates and is not monotonic increasing (:issue:`9512`)
522475
- Fixed division by zero error for ``Series.kurt()`` when all values are equal (:issue:`9197`)
523-
524-
525476
- Fixed issue in the ``xlsxwriter`` engine where it added a default 'General' format to cells if no other format wass applied. This prevented other row or column formatting being applied. (:issue:`9167`)
526477
- Fixes issue with ``index_col=False`` when ``usecols`` is also specified in ``read_csv``. (:issue:`9082`)
527478
- Bug where ``wide_to_long`` would modify the input stubnames list (:issue:`9204`)
528479
- Bug in ``to_sql`` not storing float64 values using double precision. (:issue:`9009`)
529-
530-
531480
- ``SparseSeries`` and ``SparsePanel`` now accept zero argument constructors (same as their non-sparse counterparts) (:issue:`9272`).
532481
- Regression in merging ``Categorical`` and ``object`` dtypes (:issue:`9426`)
533482
- Bug in ``read_csv`` with buffer overflows with certain malformed input files (:issue:`9205`)
534483
- Bug in groupby MultiIndex with missing pair (:issue:`9049`, :issue:`9344`)
535484
- Fixed bug in ``Series.groupby`` where grouping on ``MultiIndex`` levels would ignore the sort argument (:issue:`9444`)
536485
- Fix bug in ``DataFrame.Groupby`` where ``sort=False`` is ignored in the case of Categorical columns. (:issue:`8868`)
537-
538-
539-
540486
- Fixed bug with reading CSV files from Amazon S3 on python 3 raising a TypeError (:issue:`9452`)
541-
542487
- Bug in the Google BigQuery reader where the 'jobComplete' key may be present but False in the query results (:issue:`8728`)
543-
544-
545-
546-
547-
548488
- Bug in ``Series.values_counts`` with excluding ``NaN`` for categorical type ``Series`` with ``dropna=True`` (:issue:`9443`)

0 commit comments

Comments
 (0)