Python3, column names from array - numpy or pandas

renjith madhavan renjithmadhavan at gmail.com
Wed Dec 14 20:56:10 EST 2016


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
101, B C
102, A
103, D E

How do I do this ? I tried numpy argsort but I am new to Python and finding this challenging.
Appreciate any help in this.



More information about the Python-list mailing list