[Python] How to find relationship between values in python pandas?

Discussão em 'Python' iniciado por Stack, Março 16, 2025.

  1. Stack

    Stack Membro Participativo

    First of all, sorry about my english is not good.

    My problem is: I want to find products that can be sold together at one address by similar selling locations in using language Python pandas. For example, my dataframe like:

    PRODUCT SELLING LOCATIONS
    A 1, 2, 3
    B 2,5
    C 7,8,9,10
    D 5,4
    E 10,11

    Result is:

    A,B,D

    C,E

    Reason:

    • Product A and B has same similar selling locations is 2; Product B and D has same similar selling locations is 5. Therefor, A,B,D is can be sold together in one address.
    • Similar to product C and E.

    Continue reading...

Compartilhe esta Página