BIDS/datarray

np.outer() doesn't preserve axis names

terhorst opened this issue · 1 comments

Calling np.outer() on two DataArray vectors drops the axis names:

>>> A = DataArray([1,2,3], 'a'); B = DataArray([2,3,4], 'b')
>>> np.outer(A,B)
array([[ 2,  3,  4],
       [ 4,  6,  8],
       [ 6,  9, 12]])

Upon further consideration, since np.outer isn't a ufunc I'm not sure how we would override the behavior. The only case where it makes sense to preserve the axis names is when taking the outer product of two vectors. This could maybe be moved out to a utility library; I don't think it belongs in the core DataArray code.