Given two numpy.array
s a
and b
,
c = numpy.outer(a, b)
returns an two-dimensional array where c[i, j] == a[i] * b[j]
. Now, imagine a
having k
dimensions.
- Which operation returns an array
c
of dimensionk+1
wherec[..., j] == a * b[j]
?
Additionally, let b
have l
dimensions.
- Which operation returns an array
c
of dimensionk+1
wherec[..., i1, i2, i3] == a * b[i1, i2, i3]
?