I have a data frame df1 that looks like -
user data dep
1 ['dep_78','fg7uy8'] 78
2 ['the_dep_45','34_dep','re23u'] 45
3 ['fhj56','dep_89','hgjl09'] 91
I want to focus on the column "data" with values containing the string "dep" and see if the number attached to that string matches with the number in the "dep" column. For example, dep_78 in data colum for user 1 matches with dep 78 in dep column. I want to output the rows with a mismatch. So the result should give me -
user data dep
2 ['the_dep_45','34_dep'] 45
3 ['dep_89'] 91
The problem is to take only specific values in data column with string "dep" and then compare the numbers attached with those strings with the "dep" column.