A string is a group of characters. A string can contains any type of character including numerical characters, alphabetical characters, special characters, etc. Splitting a string means distributing a string in two or more parts. By default, a string is split with a space between two words but if we want to split a string with any other character, we need to pass the specific character inside str.split() method. Here, for splitting a string into two different columns, we are going to use str.split() method.
To work with pandas, we need to import pandas package first, below is the syntax:
import pandas as pd
Let us understand with the help of an example.
Output:

need an explanation for this answer? contact us directly to get an explanation for this answer