Say I have 3 dimensional numpy array a, for example as below:
import numpy as np
a = np.random.randn(3, 3, 3)
How can I apply (matrix->scalar)-type function to a? More specifically, I want to do an equivalent thing as below in a more computationally efficient way:
[np.linalg.det(e) for e in a]