Skip to content
Advertisement

Replace multiple strings in place that match

I want to replace multiple strings in my list of dataframes that match. I cannot get these to match and replace in place, instead it produces additional row entries.

Here’s the example data:

JavaScript

I know that int_text is the same as extract_text, but in some instances I may only have one np.log for clean_text, so I just left this as is as I would be using int_text to filter.

And what I have tried:

JavaScript

It produces the following:

JavaScript

However, it produces additional rows, I expect a clean solution like this:

JavaScript

Advertisement

Answer

JavaScript

Output:

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