3 ms·
It's simple. It's the axis that will disappear (or become length 1 with keepdims) after performing the operation.
by bonoboTP 6y ago
It's simple. It's the axis that will disappear (or become length 1 with keepdims) after performing the operation.
- throwawayiionqz 6y agoIt's not simple because there are two axis of interest: the axis along you sum, and the axis that are preserved (ie, that gives the dimension of the returned array). Both of them are of interest and after you were confused once about which one to supply to axis=..., there is no way back to clear the confusion. With einsum there is no confusion.
- evanb 6y agoIf you have a high-dimensional array then in your latter convention if you had to specify the “remaining” axes you’d need to provide a lengthy list. That’d be user-hostile.