I have a pandas column storing a np array in each row. The df looks like this:
0 [38, 324, -21]
1 [41, 325, -19]
2 [41, 325, -19]
3 [42, 326, -20]
4 [42, 326, -19]
I want to convert this column into a np array so I can use it as training data for a model. I convert it to one np array with this:
arr = df.c.values
Now, I would except the shape of this array to be (5,3)
. However, when I run:
arr.shape
I get this:
(5,)
Further, if I run:
arr[0].shape
I get (3,)
.
Why don't I just get shape (5,3)
when I run arr.shape
?