ectools/utilities.py
def sort_n(lists, key=None, reverse=False):
    """sort a list of lists by applying `key` to the first list"""
    lists = [list(x) for x in lists]
    if key is None:
        return unzip(sorted(zip(*lists), reverse=reverse))
    else:
        return unzip(sorted(zip(*lists), key=lambda x: key(x[0]), reverse=reverse))
sort a list of lists by applying `key` to the first list
sort a list of lists by applying `key` to the first list
sort a list of lists by applying ` key ` to the first list
def sort_n(lists, key=None, reverse=False):
    lists = [list(x) for x in lists]
    if key is None:
        return unzip(sorted(zip(*lists), reverse=reverse))
    else:
        return unzip(sorted(zip(*lists), key=lambda x: key(x[0]), reverse=reverse))
def sort_n ( lists , key = None , reverse = False ) : lists = [ list ( x ) for x in lists ] if key is None : return unzip ( sorted ( zip ( * lists ) , reverse = reverse ) ) else : return unzip ( sorted ( zip ( * lists ) , key = lambda x : key ( x [ 0 ] ) , reverse = reverse ) )
sort a list of lists by applying `key` to the first list
sort a list of lists by applying ` key ` to the first list
"""sort a list of lists by applying `key` to the first list"""
lists
key
reverse