Re: Python3, column names from array - numpy or pandas

2016-12-15 Thread Rhodri James
On 15/12/16 01:56, renjith madhavan wrote: I have a dataset in the below format. id A B C D E 100 1 0 0 0 0 101 0 1 1 0 0 102 1 0 0 0 0 103 0 0 0 1 1 I

Re: Python3, column names from array - numpy or pandas

2016-12-15 Thread renjith madhavan
Thank you for the reply. I tried that, I am trying to do this. The context is I am trying to find mapk ( k = 3 ) for this list. A, B , C, D and E are product names. If I am trying manually I will do something like this. TRUTH = [[A], [B,C], [A], [D,E]] and if my prediction is : PRED=[[B,A, D],

Re: Python3, column names from array - numpy or pandas

2016-12-14 Thread Miki Tebeka
You can do this with pandas: import pandas as pd from io import StringIO io = StringIO('''\ idABCDE 10010000 10101100 10210

Python3, column names from array - numpy or pandas

2016-12-14 Thread renjith madhavan
I have a dataset in the below format. id A B C D E 100 1 0 0 0 0 101 0 1 1 0 0 102 1 0 0 0 0 103 0 0 0 1 1 I would like to convert this into below: 100, A