From: Francesc A. <fa...@py...> - 2012-10-30 15:17:46
|
On 10/30/12 10:44 AM, Aquil H. Abdullah wrote: > Hello All, > > I am querying a table that has a field with a string value. I would > like to determine if the string matches a pattern. Is there a simple > way to do that through readWhere and the condition syntax? None of > the following work, but I was wondering if it were possible to do > something similar: > > table.readWhere('"CLZ' in field') or table.readWhere('symbol[:3] == > "CLZ"') As Anthony said, there is not support for this for in-kernel (or indexed) queries, but you can always use a regular query for that. I.e. something along the lines: np.fromiter((r for r in table if 'CLZ' in r['symbol']), dtype=table.dtype) -- Francesc Alted |