Let’s see how to split a text column into two columns in Pandas DataFrame.
Method #1 : Using
Split Name column into two different columns. By default splitting is done on the basis of single space by
Split Name column into “First” and “Last” column respectively and add it to the existing Dataframe .
Use underscore as delimiter to split the column into two columns.
tolist() function together.
Method #2 : Using
Split Name column into two different columns.
Split Name column into two different columns named as “First” and “Last” respectively and then add it to the existing Dataframe.
- Join two text columns into a single column in Pandas
- Split a String into columns using regex in pandas DataFrame
- Create a new column in Pandas DataFrame based on the existing columns
- Split a column in Pandas dataframe and get part of it
- Python | Pandas Split strings into two List/Columns using str.split()
- How to rename columns in Pandas DataFrame
- Difference of two columns in Pandas dataframe
- Python | Pandas DataFrame.columns
- Dealing with Rows and Columns in Pandas DataFrame
- Getting frequency counts of a columns in Pandas DataFrame
- Iterating over rows and columns in Pandas DataFrame
- How to select multiple columns in a pandas dataframe
- Conditional operation on Pandas DataFrame columns
- How to drop one or multiple columns in Pandas Dataframe
- Change Data Type for one or more columns in Pandas Dataframe
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.