|
|
|
|
|
by cl3misch
432 days ago
|
|
> In NumPy, AB works if A and B are both scalar. Or if A is 5×1×6 and B is 5×1×6×1. But not if A is 1×5×6 and B is 1×5×6×1. Huh? > So, I removed it. In DumPy you can only do AB if one of A or B is scalar or A and B have exactly the same shape. That’s it, anything else raises an error. Instead, use indices, so it’s clear what you’re doing. I also dislike the seemingly inconsistent adding of last axes with length 1. I do like the capability that existing axes of length 1 will be broadcasted to any length of the other array in the operation, and use that all the time. If I understand the text correctly, the author removed that as well. |
|