[Python] Python Pandas - Identify pairs in a dataframe based on both a string similarity in 2...

Discussão em 'Python' iniciado por Stack, Fevereiro 24, 2025.

  1. Stack

    Stack Membro Participativo

    I hope I am explaining this correctly. I have a dataframe in which i need to identify pairs of rows based on the string value of two columns. Each row in the pair must have a different string value in another column. I then need to add a new value to a new column based on TRUE or FALSE condition of that third column AND the condition of the pairing.

    For example. A simplified version of the df would be: [​IMG]

    The end result would look like this: [​IMG]

    Any help would be greatly appreciated.

    Continue reading...

Compartilhe esta Página