Python Forum
Text to column pandas - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: Text to column pandas (/thread-12460.html)



Text to column pandas - ms5573 - Aug-25-2018

Hi - I have a cvs file that has the below format. How do I apply text to column to the second column so that the data is broken out in separate columns as shown in the Expected Output.

Current Format
Name |ID | Header3
Person 1 |(‘Data’,Date of Birth’,’xyz’,’Friend’)| 1



Current Format
Name |ID | Header3
Person 1 |(‘Data’,Date of Birth’,’xyz’,’Friend’)| 1


Expected Outout
Name |Type|Metric |Code|Relation|Header3
Person 1 |Data|Date of Birth|xyz |Friend | 1

Any suggestions?