I want to set two columns from my dataframe (EisDat_cvs) as dictionary key and value in python, and everything works fine using this code:
dict_EisukeID_HMDB = EisDat_cvs.set_index('Unnamed: 28')['Unnamed: 26'].to_dict()
However now I want to append two columns as values and one as key in the dictionary, and I tried to modify the previous one as:
dict_EisukeID_HMDB = EisDat_cvs.set_index('Unnamed: 28')['Unnamed: 26', 'Unnamed: 1'].to_dict()
But python throws me a key error...
EDIT
I have a dataframe EisDat_cvs, of which I am considering 3 columns (Unnamed: 28, Unnamed: 26, Unnamed: 1). And I want to get a dictionary that takes the values in column 28 as my keys, and values in column 26 and 1 as values in the dictionary. Something like this:
Unnamed: 28, Unnamed: 26, Unnamed: 1
bla. 1 90
cra 2 12
ta 3 12
and my output should look like
dict_EisukeID_HMDB = { 'bla': '1', '90'
'cra': '2', '12'
'ta': '3', '12'}