Skip to content

Commit

Permalink
Merge pull request #31 from westurner/patch-1
Browse files Browse the repository at this point in the history
Showing the effects of rounding as in the documentation for `numpy.around`
  • Loading branch information
GaelVaroquaux committed Jun 24, 2012
2 parents 6abdd1e + c0905ff commit a304630
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions intro/numpy/elaborate_arrays.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ Forced casts::

Rounding::

>>> a = np.array([1.7, 1.2, 1.6])
>>> a = np.array([1.2, 1.5, 1.6, 2.5, 3.5, 4.5])
>>> b = np.around(a)
>>> b # still floating-point
array([ 2., 1., 2.])
array([ 1., 2., 2., 2., 4., 4.])
>>> c = np.around(a).astype(int)
>>> c
array([2, 1, 2])
array([ 1, 2, 2, 2, 4, 4])

Different data type sizes
..........................
Expand Down

0 comments on commit a304630

Please sign in to comment.