I have a DataFrame that looks like:
a b
0 [1., 2., 3.] 1.
1 [4., 5., 6.] 2.
I want a 2d numpy array that takes the list from column a and appends values from column b, like so:
[[1., 2., 3., 1.],
[4., 5., 6., 2.]]
I've tried unsuccessfully:
>>>np.c_[df.a, df.b]
array([[array([1., 2., 3.], dtype=float32), 1.],
[[array([4., 5., 6.], dtype=float32), 2.]], dtype=object)
Variants of np.hstack or np.append lead to the same result.