From: Aquil H. A. <aqu...@gm...> - 2012-10-30 14:45:09
|
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"') Thanks! -- Aquil H. Abdullah "I never think of the future. It comes soon enough" - Albert Einstein |
From: Anthony S. <sc...@gm...> - 2012-10-30 14:50:20
|
Hello Aquil, Unfortunately, You currently cannot use indexing in queries (ie "symbol[:3] == x") and may only use the whole variable ("symbol == x". This is a limitation of numexpr. Please file a ticket with them, if you would like to see this changed. Sorry! Be Well Anthony On Tue, Oct 30, 2012 at 10:44 AM, Aquil H. Abdullah < aqu...@gm...> 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"') > > Thanks! > > -- > Aquil H. Abdullah > "I never think of the future. It comes soon enough" - Albert Einstein > > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_sfd2d_oct > _______________________________________________ > Pytables-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pytables-users > > |
From: Aquil H. A. <aqu...@gm...> - 2012-10-30 14:54:19
|
Bah! Thanks for the quick reply! -- Aquil H. Abdullah "I never think of the future. It comes soon enough" - Albert Einstein On Tuesday, October 30, 2012 at 10:49 AM, Anthony Scopatz wrote: > Hello Aquil, > > Unfortunately, You currently cannot use indexing in queries (ie "symbol[:3] == x") and may only use the whole variable ("symbol == x". This is a limitation of numexpr. Please file a ticket with them, if you would like to see this changed. Sorry! > > Be Well > Anthony > > On Tue, Oct 30, 2012 at 10:44 AM, Aquil H. Abdullah <aqu...@gm... (mailto:aqu...@gm...)> 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"') > > > > Thanks! > > > > -- > > Aquil H. Abdullah > > "I never think of the future. It comes soon enough" - Albert Einstein > > > > > > ------------------------------------------------------------------------------ > > Everyone hates slow websites. So do we. > > Make your web apps faster with AppDynamics > > Download AppDynamics Lite for free today: > > http://p.sf.net/sfu/appdyn_sfd2d_oct > > _______________________________________________ > > Pytables-users mailing list > > Pyt...@li... (mailto:Pyt...@li...) > > https://lists.sourceforge.net/lists/listinfo/pytables-users > > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_sfd2d_oct > > _______________________________________________ > Pytables-users mailing list > Pyt...@li... (mailto:Pyt...@li...) > https://lists.sourceforge.net/lists/listinfo/pytables-users > > |
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 |