Hi I followed this post to convert a series into a 2d array but it doesn't work.
The dataframe
d = {'col1': [1,1,1], 'col2': [2,2,2]}
df = pd.DataFrame(data=d)
My code
np.array(df['col1'].values.tolist())
It returns a 1d array with shape(3,)
array([1, 1, 1])
I'm looking for array with shape (3,1)
Where should I revise my code ? thanks