[Numpy-discussion] Multiple Boolean Operations

Stéfan van der Walt stefan@sun.ac...
Thu May 22 12:26:33 CDT 2008


Hi Andrea

2008/5/22 Andrea Gavana <andrea.gavana@gmail.com>:
>> You clearly have a large dataset, otherwise speed wouldn't have been a
>> concern to you.  You can do your operation in one pass over the data,
>> and I'd suggest you try doing that with Cython or Ctypes.  If you need
>> an example on how to access data using those methods, let me know.
>>
>> Of course, it *can* be done using NumPy (maybe not in one pass), but
>> thinking in terms of for-loops is sometimes easier, and immediately
>> takes you to a highly optimised execution time.
>
> First of all, thank you for your answer. I know next to nothing about
> Cython and very little about Ctypes, but it would be nice to have an
> example on how to use them to speed up the operations. Actually, I
> don't really know if my dataset is "large", as I work normally with
> xCent, yCent and zCent vectors of about 100,000-300,000 elements in
> them.

Just to clarify things in my mind: is VTK *that* slow?  I find that
surprising, since it is written in C or C++.

Regards
Stéfan


More information about the Numpy-discussion mailing list