| ▲ | fph a day ago | ||||||||||||||||||||||
Actually, I just tried Y @ X in Numpy and it works just fine. It's because in Python 1-dimensional arrays are actually a thing, unlike in Matlab. That line of code is a non-example; it is easier to make it work in Python than in Matlab. | |||||||||||||||||||||||
| ▲ | ivansavz a day ago | parent [-] | ||||||||||||||||||||||
The result of `Y @ X` has shape (3,), so the next line (concatenate as columns) fails. To make `Z` a column vector, we would need something like `Z = (Y @ X)[:,np.newaxis]`. Although, I'm not sure why the author is using `concatenate` when the more idiomatic function would be stack, so the change you suggest works and is pretty clean:
with convention that vectors are shape (3,) instead of (3,1). | |||||||||||||||||||||||
| |||||||||||||||||||||||