Skip to content
Advertisement

How to reindex a dataframe post splitting a row w.r.t a column?

I have the dataframe with two columns namely Content which contains the text, and one more column named Coords which is a list of tuples. Each tuple containing the meta info of each word of the text.

JavaScript

I want to split the row such as each row can have a word, and its corresponding tuple, and the line number to act as a reference. Example:

JavaScript

Advertisement

Answer

JavaScript

Prints:

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