I'm looking to create a numpy array of lists and define the first element in each list as a number in sequence.
So far I can create the numpy array of all the first elements but they are not nested within lists as I'd like.
So I have
B=np.arange(1,10)
Bnew = B.reshape((3,3))
array([[1, 2, 3],
[4, 5, 6],
[7, 8, 9]])
but I want it to look like:
array([[[1], [2], [3]],
[[4], [5], [6]],
[[7], [8], [9]]])
as I will be adding more numbers to each list component as I continue to modify the matrix.
Thanks!