How to get a set of keys with largest values?

Davy zhushenli at
Tue Nov 13 02:36:21 CET 2007

On Nov 12, 8:54 pm, Jeff <jeffo... at> wrote:
> Why are you doing that with key-value pairs?  Why not with the array
> module or lists?


The original question is a bit complex. I have to implement a sparse
matrix which use a dict of dict implementation.
For example, sp_mat = {1:{2:1,3:4},2:{4:6,8:9}}.

And I want to get m key with the largest values in each row? Any good

Best regards,

More information about the Python-list mailing list