Is there a way to convert pandas dataframe to vectors? For example,
df
Out[53]:
Col1
3 Place
4 Country
Expected output
df_converted = 'Place','Country'
Pandas dataframes are consisted of Series, the code that you shared above is about converting a Serie into a list. You can simply run following code ;
df_converted = list(df["Col1"])
If you want to convert a dataframe into another format such as a numpy array you can find more info at https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_numpy.html for the to_numpy() method.
df_converted = 'Place','Country'does't make sense in either Python or pandas. Do you mean a list['Place','Country']`, a pandas array, a numpy array, numpy vector...? And what do you ultimately want to do with the list/vector, use it in a computation?