List of List to ndarray
That is exactly how to convert a list of lists to an ndarray in python. Are you sure your data_without_x
is filled correctly? On my machine:
data = [[1,2,3,4],[5,6,7,8]]
data_arr = np.array(data)
data_arr
array([[1,2,3,4],
[5,6,7,8]])
Which is the behavior I think you're expecting
Looking at your input you have a lot of zeros...keep in mind that the print out doesn't show all of it. You may just be seeing all the "zeros" from your input. Examine a specific non zero element to be sure