Remove masked elements from an array
James J. Besemer
jb at cascade-sys.com
Mon Apr 29 21:10:47 EDT 2002
Fernando Pérez wrote:
> James J. Besemer wrote:
>
> > THREE if you include LAMBDA.
>
> No, please heed other advice and use the MA approach. Please note that I'm not
> dissing this post on its own merits, it's a nice discussion, it just is
> ill-adapted to numeric processing. Numeric provides its own _fast_ way to
> manipulate arrays with invalid data, by all means use it. After all, speed is
> one of the big reasons why you use Numeric to begin with (you could do most
> things in it with regular lists, if you had the age of the universe to wait).
I would agree with you that it might be worth the extra trouble and effort to
download, install and learn to use Numerics IF the user in question has a big,
production application to run.
Failing that, if it's just a little application, say, filtering a small array of
numbers in a histogram, then I humbly submit that one of the several "stock"
solutions would do just nicely if not better.
Afterall, even on a crummy old sub-200 MHz PC, IIRC, the list solution was able to
so process on average about 100K elements per second (25% empty). Probably could
do 10X as fast on a new PC.
Too, I think the original question was about Language technique, as the poster
already had in hand a solution that worked.
Regards
--jb
--
James J. Besemer 503-280-0838 voice
http://cascade-sys.com 503-280-0375 fax
mailto:jb at cascade-sys.com
More information about the Python-list
mailing list