I'm taking ndarray slices with different length and I want my result to be flat. For example:
a = np.array(((np.array((1,2)), np.array((1,2,3))), (np.array((1,2)), np.array((1,2,3,4,5,6,7,8)))))
Is there any straight way to make this array flat by using numpy functionalities (without loop)?
objectdoesn't help to speed things up. They are similar to Python lists, and they are only useful if you need something exposing the same interface as a NumPy array. What is your aim with using this weird data structure?