0

I naively tried this while querying a table:

rows = [ x['title'] for x in table.where("""title[-11:] == 'string ends'""") ]

resulting in: TypeError: 'VariableNode' object has no attribute 'getitem'

Reading up on Condition Syntax doc, there is no mention of slicing.

Am I to conclude I can only query on full strings?

Thanks!

devboell
  • 1,180
  • 2
  • 16
  • 34

1 Answers1

1

Unfortunately, PyTables cannot use indexes inside of queries. This is a limitation of the operations supported in numexpr [1]. So yes, you can only query for full strings right now. I am sure that they would welcome any pull requests.

  1. http://code.google.com/p/numexpr/wiki/UsersGuide#Supported_operators
Anthony Scopatz
  • 3,265
  • 2
  • 15
  • 14
  • thanks for answering, but I am not quite sure what you mean with your last sentence. Is that a polite way of saying: implement it yourself? :-D ..... I don't think I am experienced enough, I had to look up what 'pull request' means – devboell Apr 25 '13 at 11:59