summaryrefslogtreecommitdiff
path: root/numpy/doc/broadcasting.py
diff options
context:
space:
mode:
authorTaylor Smith <tgsmith61591@gmail.com>2018-08-08 07:39:11 -0500
committerTaylor Smith <tgsmith61591@gmail.com>2018-08-08 07:39:11 -0500
commit294ee03d31b11ca1eceb8ae7a4c330b4f6ef213b (patch)
tree70a058ea541715ec933df9fdd27c1ae637809889 /numpy/doc/broadcasting.py
parent77a86c949a3d8405731f1ff3e13e665593d329fc (diff)
downloadnumpy-294ee03d31b11ca1eceb8ae7a4c330b4f6ef213b.tar.gz
DOC: Update broadcasting documentation
The exception details in the broadcast documentation were old and have since been updated. This commit changes the documentation to reflect the current exception details when a shape mismatch is raised.
Diffstat (limited to 'numpy/doc/broadcasting.py')
-rw-r--r--numpy/doc/broadcasting.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/numpy/doc/broadcasting.py b/numpy/doc/broadcasting.py
index 1dc4f60bf..73fd2cdc3 100644
--- a/numpy/doc/broadcasting.py
+++ b/numpy/doc/broadcasting.py
@@ -53,9 +53,10 @@ dimensions are compatible when
2) one of them is 1
If these conditions are not met, a
-``ValueError: frames are not aligned`` exception is thrown, indicating that
-the arrays have incompatible shapes. The size of the resulting array
-is the maximum size along each dimension of the input arrays.
+``ValueError: operands could not be broadcast together`` exception is
+thrown, indicating that the arrays have incompatible shapes. The size of
+the resulting array is the maximum size along each dimension of the input
+arrays.
Arrays do not need to have the same *number* of dimensions. For example,
if you have a ``256x256x3`` array of RGB values, and you want to scale
@@ -124,7 +125,7 @@ An example of broadcasting in practice::
(5,)
>>> x + y
- <type 'exceptions.ValueError'>: shape mismatch: objects cannot be broadcast to a single shape
+ <type 'exceptions.ValueError'>: operands could not be broadcast together with shapes (4,) (5,)
>>> xx.shape
(4, 1)