[SciPy-User] Filtering record arrays by contents of columns using `ismember`-like syntax

Skipper Seabold jsseabold at gmail.com
Mon May 23 14:45:57 EDT 2011


On Mon, May 23, 2011 at 1:23 PM, Bruce Southey <bsouthey at gmail.com> wrote:
> On 05/23/2011 10:07 AM, Skipper Seabold wrote:
>> On Mon, May 23, 2011 at 3:37 AM, Chris Rodgers
>> <chris.rodgers at berkeley.edu>  wrote:
>>> A common task for my work is slicing a record array to find records
>>> matching some set of criteria. For any criteria beyond the most
>>> simple, I find the syntax grows complex and implementation efficiency
>>> starts to matter a lot. I wrote a class to encapsulate this filtering,
>>> and I wanted to share it with the list and also get feedback on: 1) am
>>> I approaching this problem correctly?, and 2) is the implementation
>>> efficient for very large arrays?
>>>
>> I also have this problem quite frequently. I would be interested to
>> see something like this as a method of arrays and sub-classes, or at
>> least as a convenience function.
> My thought would be that PyTables would be a better and more flexible
> solution especially since fast queries are a main seeling point of PyTables.
>

I agree that if speed (and presumably size) is the main issue,
pytables might be worth it, but I see this as lightweight,
dependency-free syntactic sugar for a common use of structured arrays.

Skipper



More information about the SciPy-User mailing list