I am before my last milestone preparing suitable output. Its quite simple, I think, but my approach doesn’t work:
Given an dictionary like
mydict = {x1: (val1, dist1, (lat1, lon1)), x2: (val2, dist2, (lat2, lon2)), ...}
I tried to sort this in a nested way in an array, first using the “values” and if equals, sorting for “dist”.
However, I did my homework and tried it using this way:
import operator
s = sorted(mydict.iteritems(), key=operator.itemgetter(1))
The thing is that if the sort method would be appliable to tuples, it would be quite easy, because it’s already in the right order.
Unfortunately I get:
‘list’ object is not callable
Do you have an idea?
Is it possible you overwrote the name
sortedwith a list value?