How to split a text column into two separate columns?

Hello everyone, I need your assistance in finding alternative ways to split a text column into two separate columns using Python. I am currently working on a project that requires me to split a text column containing names into two separate columns: one for first names and another for last names.

I found out about the following method and it works fine:

1 Like

Hey @nimrah, You can use the str.split() method to split a string into a list of substrings based on the specified separator. Let’s see the example given below for a better understanding:

@nimrah, You can also use str.extract() method that extracts substrings from a string based on a regular expression pattern. For example: