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
@@ -166,18 +166,15 @@ from a ``scipy.sparse.coo_matrix``:
166
166
167
167
.. _whatsnew_0160.api_breaking:
168
168
169
-
Backwards incompatible API changes
170
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
171
-
172
169
.. _whatsnew_0160.api_breaking.timedelta:
173
170
174
-
Changes in Timedelta
175
-
~~~~~~~~~~~~~~~~~~~~
171
+
Change in Timedelta
172
+
~~~~~~~~~~~~~~~~~~~
176
173
177
174
In v0.15.0 a new scalar type ``Timedelta`` was introduced, that is a
178
175
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``.
179
176
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`)
181
178
182
179
Previous Behavior
183
180
@@ -219,62 +216,62 @@ The behavior of a small sub-set of edge cases for using ``.loc`` have changed (:
219
216
220
217
- 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.
221
218
222
-
.. ipython:: python
219
+
.. ipython:: python
223
220
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
230
227
231
-
Previous Behavior
228
+
Previous Behavior
232
229
233
-
.. code-block:: python
230
+
.. code-block:: python
234
231
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]'
237
234
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]'
240
237
241
-
New Behavior
238
+
New Behavior
242
239
243
-
.. ipython:: python
240
+
.. ipython:: python
244
241
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]
247
244
248
245
- allow slicing with float-like values on an integer index for ``.ix``. Previously this was only enabled for ``.loc``:
249
246
250
-
Previous Behavior
247
+
Previous Behavior
251
248
252
-
.. code-block:: python
249
+
.. code-block:: python
253
250
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)
256
253
257
-
New Behavior
254
+
New Behavior
258
255
259
-
.. ipython:: python
256
+
.. ipython:: python
260
257
261
-
s.ix[-1.0:2]
258
+
s.ix[-1.0:2]
262
259
263
260
- 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).
264
261
265
-
Previous Behavior
262
+
Previous Behavior
266
263
267
-
.. code-block:: python
264
+
.. code-block:: python
268
265
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]'
271
268
272
-
New Behavior
269
+
New Behavior
273
270
274
-
.. code-block:: python
271
+
.. code-block:: python
275
272
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
278
275
279
276
280
277
.. _whatsnew_0160.api:
@@ -306,31 +303,32 @@ API Changes
306
303
- 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`).
307
304
308
305
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``.
310
307
311
-
Previously even if the input dtypes were integral, the output dtype was coerced to ``bool``.
308
+
Previous Behavior
312
309
313
310
.. 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
323
321
values are the result of the bitwise operation.
324
322
325
323
.. code-block:: python
326
324
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
334
332
335
333
336
334
- 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
435
433
SQLAlchemy type (:issue:`9083`).
436
434
- Bug in ``.loc`` partial setting with a ``np.datetime64`` (:issue:`9516`)
437
435
- Incorrect dtypes inferred on datetimelike looking ``Series`` & on ``.xs`` slices (:issue:`9477`)
438
-
439
436
- 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
-
442
437
- Fixed bug on big endian platforms which produced incorrect results in ``StataReader`` (:issue:`8688`).
443
-
444
438
- Bug in ``MultiIndex.has_duplicates`` when having many levels causes an indexer overflow (:issue:`9075`, :issue:`5873`)
445
439
- Bug in ``pivot`` and ``unstack`` where ``nan`` values would break index alignment (:issue:`4862`, :issue:`7401`, :issue:`7403`, :issue:`7405`, :issue:`7466`, :issue:`9497`)
446
440
- Bug in left ``join`` on multi-index with ``sort=True`` or null values (:issue:`9210`).
447
441
- Bug in ``MultiIndex`` where inserting new keys would fail (:issue:`9250`).
448
442
- Bug in ``groupby`` when key space exceeds ``int64`` bounds (:issue:`9096`).
449
443
- Bug in ``unstack`` with ``TimedeltaIndex`` or ``DatetimeIndex`` and nulls (:issue:`9491`).
450
444
- Bug in ``rank`` where comparing floats with tolerance will cause inconsistent behaviour (:issue:`8365`).
451
-
452
-
453
445
- Fixed character encoding bug in ``read_stata`` and ``StataReader`` when loading data from a URL (:issue:`9231`).
454
-
455
446
- 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:
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
-
473
461
- 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
-
488
462
- Bug in ``DatetimeIndex`` iteration, related to (:issue:`8890`), fixed in (:issue:`9100`)
489
-
490
-
491
-
492
-
493
-
494
463
- Bug in binary operator method (eg ``.mul()``) alignment with integer levels (:issue:`9463`).
495
-
496
-
497
-
498
-
499
-
500
-
501
-
502
464
- Bug in boxplot, scatter and hexbin plot may show an unnecessary warning (:issue:`8877`)
503
465
- Bug in subplot with ``layout`` kw may show unnecessary warning (:issue:`9464`)
504
-
505
-
506
-
507
-
508
-
509
-
510
-
511
-
512
466
- Bug in using grouper functions that need passed thru arguments (e.g. axis), when using wrapped function (e.g. ``fillna``), (:issue:`9221`)
513
-
514
467
- ``DataFrame`` now properly supports simultaneous ``copy`` and ``dtype`` arguments in constructor (:issue:`9099`)
515
468
- Bug in ``read_csv`` when using skiprows on a file with CR line endings with the c engine. (:issue:`9079`)
516
469
- ``isnull`` now detects ``NaT`` in ``PeriodIndex`` (:issue:`9129`)
@@ -520,29 +473,16 @@ Bug Fixes
520
473
- Accessing ``Series.str`` methods on with non-string values now raises ``TypeError`` instead of producing incorrect results (:issue:`9184`)
521
474
- Bug in ``DatetimeIndex.__contains__`` when index has duplicates and is not monotonic increasing (:issue:`9512`)
522
475
- Fixed division by zero error for ``Series.kurt()`` when all values are equal (:issue:`9197`)
523
-
524
-
525
476
- 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`)
526
477
- Fixes issue with ``index_col=False`` when ``usecols`` is also specified in ``read_csv``. (:issue:`9082`)
527
478
- Bug where ``wide_to_long`` would modify the input stubnames list (:issue:`9204`)
528
479
- Bug in ``to_sql`` not storing float64 values using double precision. (:issue:`9009`)
529
-
530
-
531
480
- ``SparseSeries`` and ``SparsePanel`` now accept zero argument constructors (same as their non-sparse counterparts) (:issue:`9272`).
532
481
- Regression in merging ``Categorical`` and ``object`` dtypes (:issue:`9426`)
533
482
- Bug in ``read_csv`` with buffer overflows with certain malformed input files (:issue:`9205`)
534
483
- Bug in groupby MultiIndex with missing pair (:issue:`9049`, :issue:`9344`)
535
484
- Fixed bug in ``Series.groupby`` where grouping on ``MultiIndex`` levels would ignore the sort argument (:issue:`9444`)
536
485
- Fix bug in ``DataFrame.Groupby`` where ``sort=False`` is ignored in the case of Categorical columns. (:issue:`8868`)
537
-
538
-
539
-
540
486
- Fixed bug with reading CSV files from Amazon S3 on python 3 raising a TypeError (:issue:`9452`)
541
-
542
487
- 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
-
548
488
- Bug in ``Series.values_counts`` with excluding ``NaN`` for categorical type ``Series`` with ``dropna=True`` (:issue:`9443`)
0 commit comments