Let\'s write it directly in code
Note: I edited mapper (original example use x -> (x, 2 * x, 3 * x) just for example), to generic blackbox function, which cause the trou
I might be getting this wrong, but comprehension does the job:
a = np.array([[0, 1], [2, 3]]) np.array([[[j, j*2, j*3] for j in i] for i in a ]) #[[[0 0 0] # [1 2 3]] # # [[2 4 6] # [3 6 9]]]