i have a dataset structure like this :
| id | age | name | income |
----------------------------
| 0 | 9 | AA | 300 |
| 1 | 6 | ZZ | 100 |
and how to extract age
and income
and then combining again and convert those data into multidimentional list like this :
[
[9, 300],
[6, 100]
]
i've tried a concate
from pandas documentation, but it goes wrong when i converted it into list. my code is :
dataframe = pd.read_csv('my.csv')
data = pd.concat([dataset['age'], dataset['income']], axis=1)
everything is fine if i type print(data)
, the result is dataframe is already merged.
But if i type print(list(data))
the result i received is only header's name appear.
maybe you guys know how to solve my problem, any help will be appreciated
thanks