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.16.0.txt
+37-37Lines changed: 37 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -168,8 +168,8 @@ from a ``scipy.sparse.coo_matrix``:
168
168
169
169
.. _whatsnew_0160.api_breaking.timedelta:
170
170
171
-
Change in Timedelta
172
-
~~~~~~~~~~~~~~~~~~~
171
+
Changes in Timedelta
172
+
~~~~~~~~~~~~~~~~~~~~
173
173
174
174
In v0.15.0 a new scalar type ``Timedelta`` was introduced, that is a
175
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``.
@@ -214,64 +214,64 @@ Indexing Changes
214
214
215
215
The behavior of a small sub-set of edge cases for using ``.loc`` have changed (:issue:`8613`). Furthermore we have improved the content of the error messages that are raised:
216
216
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.
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.
218
218
219
-
.. ipython:: python
219
+
.. ipython:: python
220
220
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
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
227
227
228
-
Previous Behavior
228
+
Previous Behavior
229
229
230
-
.. code-block:: python
230
+
.. code-block:: python
231
231
232
-
In [4]: df.loc['2013-01-02':'2013-01-10']
233
-
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]'
234
234
235
-
In [6]: s.loc[-10:3]
236
-
KeyError: 'start bound [-10] is not the [index]'
235
+
In [6]: s.loc[-10:3]
236
+
KeyError: 'start bound [-10] is not the [index]'
237
237
238
-
New Behavior
238
+
New Behavior
239
239
240
-
.. ipython:: python
240
+
.. ipython:: python
241
241
242
-
df.loc['2013-01-02':'2013-01-10']
243
-
s.loc[-10:3]
242
+
df.loc['2013-01-02':'2013-01-10']
243
+
s.loc[-10:3]
244
244
245
-
- allow slicing with float-like values on an integer index for ``.ix``. Previously this was only enabled for ``.loc``:
245
+
- Allow slicing with float-like values on an integer index for ``.ix``. Previously this was only enabled for ``.loc``:
246
246
247
-
Previous Behavior
247
+
Previous Behavior
248
248
249
-
.. code-block:: python
249
+
.. code-block:: python
250
250
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)
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)
253
253
254
-
New Behavior
254
+
New Behavior
255
255
256
-
.. ipython:: python
256
+
.. ipython:: python
257
257
258
-
s.ix[-1.0:2]
258
+
s.ix[-1.0:2]
259
259
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).
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).
261
261
262
-
Previous Behavior
262
+
Previous Behavior
263
263
264
-
.. code-block:: python
264
+
.. code-block:: python
265
265
266
-
In [4]: df.loc[2:3]
267
-
KeyError: 'start bound [2] is not the [index]'
266
+
In [4]: df.loc[2:3]
267
+
KeyError: 'start bound [2] is not the [index]'
268
268
269
-
New Behavior
269
+
New Behavior
270
270
271
-
.. code-block:: python
271
+
.. code-block:: python
272
272
273
-
In [4]: df.loc[2:3]
274
-
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
0 commit comments