Skip to content
Advertisement

Find all occurrences of substring in a vector and save results to another column

I have a data frame look like this:

JavaScript

I want to find all 'E' in each string and save the indices into another column. I was trying with re.finditer and map to convert list to a string and save for each row but no luck yet. What would be a good approach?

Advertisement

Answer

This will work:

JavaScript

Output:

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