how to split a comma separated string and add as a new row using pandas

Viewed 12

Hi i have a table in which i need to split a string seperated by commas and add a new row below using Pandas

For instance :

Account no city branch Name
001 NY BK James Stern,Kevin Mcdonald
002 NY Queens Joshua Tobey,David Garrigus
003 NY Nassau Lukas Burlage,Laura Burlage

I want the output as:

Account no city branch Name
001 NY BK James Stern
001 NY BK Kevin Mcdonald
002 NY Queens Joshua Tobey
002 NY Queens David Garrigus
003 NY Nassau Lukas Burlage
003 NY Nassau Laura Burlage

Kindly help

0 Answers
Related