How to Convert multiple sets of Data going from left to right to top to bottom the Pythonic way?
- by ThinkCode
Following is a sample of sets of contacts for each company going from left to right.
ID Company ContactFirst1 ContactLast1 Title1 Email1 ContactFirst2 ContactLast2 Title2 Email2
1 ABC John Doe CEO jd@abc.com Steve Bern CIO sb@abc.com
How do I get them to go top to bottom as shown?
ID Company Contactfirst ContactLast Title Email
1 ABC John Doe CEO jd@abc.com
1 ABC Steve Bern CIO sb@abc.com
I am hoping there is a Pythonic way of solving this task. Any pointers or samples are really appreciated!
p.s : In the actual file, there are 10 sets of contacts going from left to right and there are few thousand such records. It is a CSV file and I loaded into MySQL to manipulate the data.