[Python] Extracting all routes in a From To data set in R or Python

Discussão em 'Python' iniciado por Stack, Maio 4, 2025.

  1. Stack

    Stack Membro Participativo

    From this data set of supply chains I am trying to extract each and every route and put all the stages of one specific route in one vector such as this. This is how the from to data is stored.

    From To
    Manuf_0001 Retail_0001
    Manuf_0001 Retail_0002
    Manuf_0002 Retail_0003
    Manuf_0002 Retail_0001
    Part_0001 Manuf_0001
    Part_0001 Manuf_0002
    Part_0002 Manuf_0001
    Part_0002 Manuf_0002
    Part_0003 Manuf_0001
    Part_0003 Manuf_0002


    [​IMG]

    And this is how I want the vectors of each route to be outputted.

    Part_0001, Manuf_0001, Retail_0001
    Part_0001, Manuf_0001, Retail_0002
    Part_0002, Manuf_0001, Retail_0001
    Part_0002, Manuf_0002, Retail_0002
    Part_0002, Manuf_0002, Retail_0003
    Part_0003, Manuf_0001, Retail_0001
    Part_0003, Manuf_0002, Retail_0002
    Part_0003, Manuf_0002, Retail_0003

    Continue reading...

Compartilhe esta Página