Skip to content
Advertisement

New rows based on a string – Pandas. python

I have this pandas df

JavaScript

I need to be able to break down the ‘cast” field in such a way that it is in several rows Example:

JavaScript

I understand that I should do it with pandas, but it is very complicated, can you help me?

Advertisement

Answer

You can use spit and explode:

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