How can i construct a numpy one dimension array of lists
np.array([[1,2,3], [4,5,6]], dtype=np.object)
will create a numpy array of (2,3) while i want it to be a one dimension (2, )
for example if the list where unequal
np.array([[1,2,3], [4,5]], dtype=np.object)
it would result in a one dimension (2, )
i understand that numpy is trying to optimize the types and space but i need to force it to be one dimension
i can do this
arr = np.empty(2, dtype=object)
arr[0] = [1, 2, 3]
arr[1] = [1, 2, 4]
But it is ugly, is there a better way?
(2,3), why not create a list of sublists directly?