Skip to content
Advertisement

How to split a column and add additional rows from the split values in pandas?

I have a dataframe as:

JavaScript

enter image description here

Here i would like to split a column middle_name using delimeter semicolon ‘;’.

after splitting i would like to have a additional rows as many spitted words as existed.

for example:

JavaScript

should be

JavaScript

Advertisement

Answer

JavaScript

here is the documentation of df.explode() doc

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement