kamome
kamome

Reputation: 858

How to split a pandas serie in two columns separate by comma

I have a pandas serie.

13/08/2020 5:54;;; xxxxxxxxx
13/08/2020 5:54;;; yyyyyyy

How do I do to split the serie by ";;;" into two new columns?

Upvotes: 1

Views: 69

Answers (1)

Edunne
Edunne

Reputation: 234

You can use Series.str.split. By default it returns a series with a list of values, but you can set the expand parameter flag to get it to return a dataframe:

mydf = myseries.str.split(";;;", expand=True)

Upvotes: 1

Related Questions