Hi,

I need to have list of objects that contain ndarrays to be sorted. The
reason that I want them sorted is that these list are populated in an
arbitrary order, but there order really doesn't matter, and I am trying
to make it reproducible for debugging and hashing.

The problem is that ndarrays cannot be compared. So I have tried to
override the 'cmp' in the 'sorted' function, however I am comparing
fairly complex objects, and I am having a hard time predicting wich
member of the object will contain the array. So I am building a more and
more complex 'cmp' replacement.

Does anybody has a good idea what a better strategy would be?

Cheers,

Gaƫl
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to