Skip to content

Commit 98857c1

Browse files
committed
DOC: Add notes about truedivision
1 parent 57f4c03 commit 98857c1

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

doc/source/release.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,25 @@ API Changes
376376
dates are given (:issue:`5242`)
377377
- ``Timestamp`` now supports ``now/today/utcnow`` class methods
378378
(:issue:`5339`)
379+
- **All** division with ``NDFrame`` - likes is now truedivision, regardless
380+
of the future import. You can use ``//`` and ``floordiv`` to do integer
381+
division.
382+
383+
.. code-block:: python
384+
In [3]: arr = np.array([1, 2, 3, 4])
385+
386+
In [4]: arr2 = np.array([5, 3, 2, 1])
387+
388+
In [5]: arr / arr2
389+
Out[5]: array([0, 0, 1, 4])
390+
391+
In [6]: pd.Series(arr) / pd.Series(arr2) # no future import required
392+
Out[6]:
393+
0 0.200000
394+
1 0.666667
395+
2 1.500000
396+
3 4.000000
397+
dtype: float64
379398
380399
Internal Refactoring
381400
~~~~~~~~~~~~~~~~~~~~

doc/source/v0.13.0.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,26 @@ API changes
5555
# and all methods take an inplace kwarg - but returns None
5656
index.set_names(["bob", "cranberry"], inplace=True)
5757

58+
- **All** division with ``NDFrame`` - likes is now truedivision, regardless
59+
of the future import. You can use ``//`` and ``floordiv`` to do integer
60+
division.
61+
62+
.. code-block:: python
63+
In [3]: arr = np.array([1, 2, 3, 4])
64+
65+
In [4]: arr2 = np.array([5, 3, 2, 1])
66+
67+
In [5]: arr / arr2
68+
Out[5]: array([0, 0, 1, 4])
69+
70+
In [6]: pd.Series(arr) / pd.Series(arr2) # no future import required
71+
Out[6]:
72+
0 0.200000
73+
1 0.666667
74+
2 1.500000
75+
3 4.000000
76+
dtype: float64
77+
5878
- Infer and downcast dtype if ``downcast='infer'`` is passed to ``fillna/ffill/bfill`` (:issue:`4604`)
5979
- ``__nonzero__`` for all NDFrame objects, will now raise a ``ValueError``, this reverts back to (:issue:`1073`, :issue:`4633`)
6080
behavior. See :ref:`gotchas<gotchas.truth>` for a more detailed discussion.

0 commit comments

Comments
 (0)