Skip to content

Commit 96d386f

Browse files
committed
DOC: some more changes in 0.16.0.txt
1 parent cba1214 commit 96d386f

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

doc/source/whatsnew/v0.16.0.txt

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ from a ``scipy.sparse.coo_matrix``:
168168

169169
.. _whatsnew_0160.api_breaking.timedelta:
170170

171-
Change in Timedelta
172-
~~~~~~~~~~~~~~~~~~~
171+
Changes in Timedelta
172+
~~~~~~~~~~~~~~~~~~~~
173173

174174
In v0.15.0 a new scalar type ``Timedelta`` was introduced, that is a
175175
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
214214

215215
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:
216216

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

219-
.. ipython:: python
219+
.. ipython:: python
220220

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
227227

228-
Previous Behavior
228+
Previous Behavior
229229

230-
.. code-block:: python
230+
.. code-block:: python
231231

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]'
234234

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]'
237237

238-
New Behavior
238+
New Behavior
239239

240-
.. ipython:: python
240+
.. ipython:: python
241241

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]
244244

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``:
246246

247-
Previous Behavior
247+
Previous Behavior
248248

249-
.. code-block:: python
249+
.. code-block:: python
250250

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

254-
New Behavior
254+
New Behavior
255255

256-
.. ipython:: python
256+
.. ipython:: python
257257

258-
s.ix[-1.0:2]
258+
s.ix[-1.0:2]
259259

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).
261261

262-
Previous Behavior
262+
Previous Behavior
263263

264-
.. code-block:: python
264+
.. code-block:: python
265265

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]'
268268

269-
New Behavior
269+
New Behavior
270270

271-
.. code-block:: python
271+
.. code-block:: python
272272

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
275275

276276

277277
.. _whatsnew_0160.api:

0 commit comments

Comments
 (0)