[Python] Min and Max value on multiple cells group by third column value

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

  1. Stack

    Stack Membro Participativo

    I would like to extract the MIN and MAX from multiple columns (start_1, end_1, start_2, end_2) group by "Name"

    I have data that looks like this:

    start_1 end_1 start_2 end_2 name
    100 200 300 400 ABC
    100 200 300 400 ABC
    150 250 300 400 ABC
    300 200 300 900 DEF
    50 200 300 1000 DEF


    The output should be like this:

    start end name
    100 400 ABC
    50 1000 DEF


    Looked into following answers already: Group by pandas Column

    using-pandas-want-to-group-by-multiple-columns-for-min-max-and-add-another-colu

    Looking forward for your asistance

    Continue reading...

Compartilhe esta Página