Skip to content

Commit c567701

Browse files
committed
DOC: cleaning in v0.16.0.txt
1 parent c1e52f1 commit c567701

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

doc/source/timedeltas.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ For a ``Series``
266266
td.dt.days
267267
td.dt.seconds
268268
269-
You can access the component field for a scalar ``Timedelta`` directly.
269+
You can access the value of the fields for a scalar ``Timedelta`` directly.
270270

271271
.. ipython:: python
272272

doc/source/whatsnew/v0.16.0.txt

+20-20
Original file line numberDiff line numberDiff line change
@@ -29,38 +29,38 @@ Backwards incompatible API changes
2929

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

32-
So in v0.16.0, we are restoring the API to match that of ``datetime.timedelta``. However, 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`)
32+
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`)
3333

34-
Previous Behavior
34+
Previous Behavior
3535

36-
.. code-block:: python
36+
.. code-block:: python
3737

38-
In [2]: t = pd.Timedelta('1 day, 10:11:12.100123')
38+
In [2]: t = pd.Timedelta('1 day, 10:11:12.100123')
3939

40-
In [3]: t.days
41-
Out[3]: 1
40+
In [3]: t.days
41+
Out[3]: 1
4242

43-
In [4]: t.seconds
44-
Out[4]: 12
43+
In [4]: t.seconds
44+
Out[4]: 12
4545

46-
In [5]: t.microseconds
47-
Out[5]: 123
46+
In [5]: t.microseconds
47+
Out[5]: 123
4848

49-
New Behavior
49+
New Behavior
5050

51-
.. ipython:: python
51+
.. ipython:: python
5252

53-
t = pd.Timedelta('1 day, 10:11:12.100123')
54-
t.days
55-
t.seconds
56-
t.microseconds
53+
t = pd.Timedelta('1 day, 10:11:12.100123')
54+
t.days
55+
t.seconds
56+
t.microseconds
5757

58-
Using ``.components`` allows the full component access
58+
Using ``.components`` allows the full component access
5959

60-
.. ipython:: python
60+
.. ipython:: python
6161

62-
t.components
63-
t.components.seconds
62+
t.components
63+
t.components.seconds
6464

6565
- ``Index.duplicated`` now returns `np.array(dtype=bool)` rather than `Index(dtype=object)` containing `bool` values. (:issue:`8875`)
6666
- ``DataFrame.to_json`` now returns accurate type serialisation for each column for frames of mixed dtype (:issue:`9037`)

0 commit comments

Comments
 (0)