Skip to content
Advertisement

Python pandas .str.split regex=True ValueError: Columns must be same length as key

I need help with this pandas split with regex. I’m getting the error ValueError: Columns must be same length as key.

my column of data is like this

JavaScript

my code is

JavaScript

desired results would be.

JavaScript

Advertisement

Answer

Given:

JavaScript

Doing:

JavaScript

Output:

JavaScript

Works fine for me.

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