summaryrefslogtreecommitdiff
path: root/doc/source/user
diff options
context:
space:
mode:
authorSeva Lotoshnikov <vlotoshnikov@gmail.com>2022-06-24 02:09:03 -0700
committerSeva Lotoshnikov <vlotoshnikov@gmail.com>2022-07-05 19:06:14 -0700
commite7c98ecdfb55ce396cbd9e5644d805690249b356 (patch)
tree5b7e64c80c0065fbd95295505f3217432a9c2c35 /doc/source/user
parentfa5bffc454fbafacfb3298ac30ea335635b54d07 (diff)
downloadnumpy-e7c98ecdfb55ce396cbd9e5644d805690249b356.tar.gz
DOC: Rephrase dimensionality, size in broadcasting.rst
Diffstat (limited to 'doc/source/user')
-rw-r--r--doc/source/user/basics.broadcasting.rst12
1 files changed, 8 insertions, 4 deletions
diff --git a/doc/source/user/basics.broadcasting.rst b/doc/source/user/basics.broadcasting.rst
index d46b8befb..edd0bf15c 100644
--- a/doc/source/user/basics.broadcasting.rst
+++ b/doc/source/user/basics.broadcasting.rst
@@ -70,14 +70,18 @@ It starts with the trailing (i.e. rightmost) dimensions and works its
way left. Two dimensions are compatible when
1) they are equal, or
-2) one of them is 1
+2) one of them is 1.
If these conditions are not met, a
``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 size that is not 1 along each axis of the inputs.
+thrown, indicating that the arrays have incompatible shapes.
-Arrays do not need to have the same *number* of dimensions. For example,
+Arrays do not need to have the same *number* of dimensions. Resulting
+array has as many dimensions as the largest (by number of dimensions)
+of inputs. Size, along each axis, of the resulting array is equal to
+the largest size, along the same axis, of all inputs.
+
+For example,
if you have a ``256x256x3`` array of RGB values, and you want to scale
each color in the image by a different value, you can multiply the image
by a one-dimensional array with 3 values. Lining up the sizes of the