Import two columns from csv into python under one header numpy list
You can use: df.values.tolist().
First select the columns from the name of your dataframe:
df = pd.DataFrame(name_of_dataframe, columns= ['col1', 'col2'])
Next change it to a list: list = df.values.tolist().
Then flatten the list with a loop appending each smaller list into one bigger list.
I have a data set that consists of two columns as coordinates. I would like to import them to python under one header list called "coordinates". Does anyone have any solution?. Thanks!