[Python] Python: sorting items with string, int and float values

Discussão em 'Python' iniciado por Stack, Setembro 24, 2024.

  1. Stack

    Stack Membro Participativo

    I got a following dictionary look like this:

    ('NM_000165', ['GJA1', 89393, 169.29])


    Wondering how to sort by the last column(the one consist with float value)

    I have tried:

    sorted_filtered_common = dict(sorted(filtered_common.items(), key=lambda item: item[1][1]))


    However, this code only sort the second last column, and I am aiming for is the last column.

    Continue reading...

Compartilhe esta Página