bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / broadcast
class
numpy:broadcast
source: /dev/numpy/build-install/usr/lib/python3.14/site-packages/numpy/__init__.py
Signature
class broadcast ( * arrays ) Summary
Produce an object that mimics broadcasting.
Parameters
in1, in2, ...: array_likeInput parameters.
Returns
b: broadcast objectBroadcast the input parameters against one another, and return an object that encapsulates the result. Amongst others, it has
shapeandndproperties, and may be used as an iterator.
Examples
Manually adding two vectors, using broadcasting:import numpy as np x = np.array([[1], [2], [3]]) y = np.array([4, 5, 6]) b = np.broadcast(x, y)✓
out = np.empty(b.shape) out.flat = [u+v for (u,v) in b]✓
out
✗x + y
✓See also
Aliases
-
numpy.broadcast