In [1]:
import numpy as np

In [2]:
a = np.arange(3)
print(a)


[0 1 2]

In [3]:
print(a.shape)


(3,)

In [4]:
b = np.arange(3).reshape(3, 1)
print(b)


[[0]
 [1]
 [2]]

In [5]:
print(b.shape)


(3, 1)

In [6]:
arrays = np.broadcast_arrays(a, b)

In [7]:
print(type(arrays))


<class 'list'>

In [8]:
print(len(arrays))


2

In [9]:
print(arrays[0])


[[0 1 2]
 [0 1 2]
 [0 1 2]]

In [10]:
print(arrays[1])


[[0 0 0]
 [1 1 1]
 [2 2 2]]

In [11]:
print(type(arrays[0]))


<class 'numpy.ndarray'>

In [12]:
c = np.zeros((2, 2))
print(c)


[[0. 0.]
 [0. 0.]]

In [13]:
print(c.shape)


(2, 2)

In [14]:
# arrays = np.broadcast_arrays(a, c)
# ValueError: shape mismatch: objects cannot be broadcast to a single shape