python 2.7 - How to sort defaultdict(list) such that all lists are sorted based on one key? -
to amazing programmers, i know how can sort defaultdict(list) collection such sort order of 1 list (e.g. defaultdict(list)[list1]) applied remaining lists well. perhaps short description/example more useful. if there better way of doing ears. example problem: had .csv file consisting of many columns (different data types) , headerline. using defaultdict(list) import .csv file using: data = defaultdict(list) reader = csv.dictreader(open(filepath, 'r')) (k,v) in row.items(): data[k].append(v) now left defaultdict(list) named 'data' of structure: data = [('vara', <list of n time.struct_time items>), ('varb', <list of n other data type items>)', ('varc', <list of n other data type items>)'] each list (vara, varb, varc) has exact same number of items. assuming vara not ordered, how order data entries based on vara. i know sortorder = [i[0] in sorted(enumerate(data['vara']), key...