Skip to content
Advertisement

Compare two data frames and find number of nulls

I have a problem. I heve data frame 1 named “df”:

enter image description here

And I have the data frame 2 named “dfP1”:

enter image description here

I want to compare the unique rows that exist in colum “Campo a Validar” from “dfP1” vs the columns in “df”, if exist a coincidence that count the number of nulls in the colum that match. And then the number of nulls will insert in the data frame df into a new colum name “Numeros_de_nulos” but only in the row 0 (index 0).

Here is something that tried:

Advertisement

Answer

It was a bit challenging to determine what you needed, but this might come close to your ideal solution.

Output:

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