From: Bill B. <wb...@gm...> - 2006-05-18 14:56:41
|
One thing I haven't quite managed to figure out yet, is what the heck indexing an array with an array is supposed to give you. This is sort of an offshoot of the "nonzero()" discussion. I was wondering why nonzero() and where() return tuples at all instead of just an array, till I tried it. >>> b array([[0, 1, 2], [3, 4, 5], [6, 7, 8]]) >>> b[ num.asarray(num.where(b>4)) ] array([[[3, 4, 5], [6, 7, 8], [6, 7, 8], [6, 7, 8]], [[6, 7, 8], [0, 1, 2], [3, 4, 5], [6, 7, 8]]]) Whoa, not sure what that is. Can someone explain the current rule and in what situations is it useful? Thanks --bb |