diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2016-06-17 13:53:48 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-17 13:53:48 -0600 |
commit | d3afd5057ca05ae7d315c68e5009b3ee183860e3 (patch) | |
tree | 346c31ee289f6eaf189a74a15c8735a50918dcb1 /numpy/add_newdocs.py | |
parent | 4ccf3d7378a5dd9094a7e27c180eda01d7487278 (diff) | |
parent | 71c18e964e36f3875db867ae45b6e22fb551ae85 (diff) | |
download | numpy-d3afd5057ca05ae7d315c68e5009b3ee183860e3.tar.gz |
Merge pull request #7754 from charris/update-7612
Update 7612, ENH: Add broadcast.ndim to match code elsewhere.
Diffstat (limited to 'numpy/add_newdocs.py')
-rw-r--r-- | numpy/add_newdocs.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py index 46601b8ef..c6ceb29c6 100644 --- a/numpy/add_newdocs.py +++ b/numpy/add_newdocs.py @@ -552,9 +552,26 @@ add_newdoc('numpy.core', 'broadcast', ('iters', """)) +add_newdoc('numpy.core', 'broadcast', ('ndim', + """ + Number of dimensions of broadcasted result. Alias for `nd`. + + .. versionadded:: 1.12.0 + + Examples + -------- + >>> x = np.array([1, 2, 3]) + >>> y = np.array([[4], [5], [6]]) + >>> b = np.broadcast(x, y) + >>> b.ndim + 2 + + """)) + add_newdoc('numpy.core', 'broadcast', ('nd', """ - Number of dimensions of broadcasted result. + Number of dimensions of broadcasted result. For code intended for Numpy + 1.12.0 and later the more consistent `ndim` is preferred. Examples -------- |