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 [email protected] Steve Bern CIO [email protected]
How do I get them to go top to bottom as shown?
ID Company Contactfirst ContactLast Title Email
1 ABC John Doe CEO [email protected]
1 ABC Steve Bern CIO [email protected]
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.