Skip to content
Advertisement

compare 2 string columns in data frame and add 1 to key if different

I’m having a hard time trying to figure this out, I have a data frame with multiple columns after merging 2.

JavaScript

I have 2 list:

JavaScript

I need to compare each group of variables and if they are different add 1 to the key column

JavaScript

I was trying to use something like this:

JavaScript

Advertisement

Answer

I would avoid loops. Is there any reason we cant do it directly? Lets try

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