I have a pandas frame like this.
pd.DataFrame(data={'name':['name1','name2'],'vector':[np.array([1,2,3,4]),np.array([12,22,34,4])]})
I want to extract the vectors from the frame as a matrix like this.
np.array([[1,2,3,4],[12,22,34,4]])
np.array(df['vector'].tolist())
will result in
array([[ 1, 2, 3, 4],
[12, 22, 34, 4]])
or
df['vector'].as_matrix()
will result in
array([array([1, 2, 3, 4]), array([12, 22, 34, 4])], dtype=object)