summaryrefslogtreecommitdiff
path: root/numpy/add_newdocs.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/add_newdocs.py')
-rw-r--r--numpy/add_newdocs.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py
index 38da1f0b3..316b38e77 100644
--- a/numpy/add_newdocs.py
+++ b/numpy/add_newdocs.py
@@ -3060,9 +3060,17 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('size',
"""
Number of elements in the array.
- Equivalent to ``np.prod(a.shape)``, i.e., the product of the array's
+ Equal to ``np.prod(a.shape)``, i.e., the product of the array's
dimensions.
+ Notes
+ -----
+ `a.size` returns a standard arbitrary precision Python integer. This
+ may not be the case with other methods of obtaining the same value
+ (like the suggested ``np.prod(a.shape)``, which returns an instance
+ of ``np.int_``), and may be relevant if the value is used further in
+ calculations that may overflow a fixed size integer type.
+
Examples
--------
>>> x = np.zeros((3, 5, 2), dtype=np.complex128)