Python Sort a list based on a given order – stackoverflow.com

I have a list, say A = [[3,5],[1,3],[6,1]]. And I have another list, say B = [6,1,3] I want to sort list A so that A becomes [[6,1],[1,3],[3,5]] , which fits the given B. I.e. the first member of ...

from Hot Questions - Stack Exchange OnStackOverflow
via Blogspot

Share this

Artikel Terkait

0 Comment to "Python Sort a list based on a given order – stackoverflow.com"