mercredi 27 juillet 2016

Lexicographic comparison of two numpy ndarrays

I couldn't find a straightforward way to compare two (multidimensional in my case) arrays the in a lexicographic way.

Ie.

a = [1,2,3,4]
b = [4,0,1,6]

For a < b I want to get true where I get [true, false, false, true]
For a > b I want to get false where I get [false, true, true, false]

Aucun commentaire:

Enregistrer un commentaire