Oh, I pressed "send" too early. Just an addition: numpy.where creates a new array from some condition. If you only want to change elements of an existing array that satisfies a given condition, indexing is far more efficient: no temporary is created. Hence the suggestion of a[a<0] _______________________________________________ Numpy-discussion mailing list [email protected] http://projects.scipy.org/mailman/listinfo/numpy-discussion
- [Numpy-discussion] efficient use of numpy.where() and .any(... Mark.Miller
- Re: [Numpy-discussion] efficient use of numpy.where() ... Pierre GM
- Re: [Numpy-discussion] efficient use of numpy.wher... Mark.Miller
- Re: [Numpy-discussion] efficient use of numpy.... Robert Kern
- Re: [Numpy-discussion] efficient use of nu... Mark.Miller
- Re: [Numpy-discussion] efficient use of numpy.... Pierre GM
- Re: [Numpy-discussion] efficient use of numpy.wher... Anne Archibald
- Re: [Numpy-discussion] efficient use of numpy.... Pierre GM
- Re: [Numpy-discussion] efficient use of nu... Anne Archibald
- Re: [Numpy-discussion] efficient use ... Francesc Altet
- Re: [Numpy-discussion] efficient use of numpy.where() ... Pierre GM
