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.py42
1 files changed, 30 insertions, 12 deletions
diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py
index a6d7dc32e..a53db35d4 100644
--- a/numpy/add_newdocs.py
+++ b/numpy/add_newdocs.py
@@ -752,8 +752,8 @@ add_newdoc('numpy.core.multiarray', 'empty',
Returns
-------
out : ndarray
- Array of uninitialized (arbitrary) data with the given
- shape, dtype, and order.
+ Array of uninitialized (arbitrary) data of the given shape, dtype, and
+ order. Object arrays will be initialized to None.
See Also
--------
@@ -2108,7 +2108,7 @@ add_newdoc('numpy.core', 'einsum',
Using the Einstein summation convention, many common multi-dimensional
array operations can be represented in a simple fashion. This function
- provides a way compute such summations. The best way to understand this
+ provides a way to compute such summations. The best way to understand this
function is to try the examples below, which show how many common NumPy
functions can be implemented as calls to `einsum`.
@@ -3242,7 +3242,7 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('astype',
-------
arr_t : ndarray
Unless `copy` is False and the other conditions for returning the input
- array are satisfied (see description for `copy` input paramter), `arr_t`
+ array are satisfied (see description for `copy` input parameter), `arr_t`
is a new array of the same shape as the input array, with dtype, order
given by `dtype`, `order`.
@@ -3784,24 +3784,40 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('min',
"""))
-add_newdoc('numpy.core.multiarray', 'may_share_memory',
+add_newdoc('numpy.core.multiarray', 'shares_memory',
"""
- Determine if two arrays can share memory
+ shares_memory(a, b, max_work=None)
- The memory-bounds of a and b are computed. If they overlap then
- this function returns True. Otherwise, it returns False.
-
- A return of True does not necessarily mean that the two arrays
- share any element. It just means that they *might*.
+ Determine if two arrays share memory
Parameters
----------
a, b : ndarray
+ Input arrays
+ max_work : int, optional
+ Effort to spend on solving the overlap problem (maximum number
+ of candidate solutions to consider). The following special
+ values are recognized:
+
+ max_work=MAY_SHARE_EXACT (default)
+ The problem is solved exactly. In this case, the function returns
+ True only if there is an element shared between the arrays.
+ max_work=MAY_SHARE_BOUNDS
+ Only the memory bounds of a and b are checked.
+
+ Raises
+ ------
+ numpy.TooHardError
+ Exceeded max_work.
Returns
-------
out : bool
+ See Also
+ --------
+ may_share_memory
+
Examples
--------
>>> np.may_share_memory(np.array([1,2]), np.array([5,8,9]))
@@ -6207,7 +6223,7 @@ add_newdoc('numpy.core.multiarray', 'dtype', ('itemsize',
add_newdoc('numpy.core.multiarray', 'dtype', ('kind',
"""
- A character code (one of 'biufcOSUV') identifying the general kind of data.
+ A character code (one of 'biufcmMOSUV') identifying the general kind of data.
= ======================
b boolean
@@ -6215,6 +6231,8 @@ add_newdoc('numpy.core.multiarray', 'dtype', ('kind',
u unsigned integer
f floating-point
c complex floating-point
+ m timedelta
+ M datetime
O object
S (byte-)string
U Unicode