Categories
Development

Does numpy treat 1-D slices of arrays in a strange way?

import numpy as np a = np.array([[(1, 2, 3), 40, 50], [(4, 5, 6), 70, 80]]) Using only numpy operations (i.e., without explicit python-style list construction or loops; the goal is to save time, if possible), how do I create a 2-by-3 numpy array (matrix) [[1,2,3], [4,5,6]] from the above array a? The slice a[:, […]