【发布时间】:2014-03-07 09:56:26
【问题描述】:
我正在使用 Python 2.7,并尝试执行 PyTables 查询:
#Here the condition
selectedIndex = [1,6,7,9]
condition = 'IndexColumn in selectedIndex'
#here the query
for x1 in tab.where(condition,selectedIndex):
...
...
...
我得到了:
TypeError: argument of type 'VariableNode' is not iterable
从有关 pytables 的文档中,我正在尝试使用它:
Table.where(condition, condvars=None, start=None, stop=None, step=None)
还有:
condition = 'col1 == "AAAA"'
for record in table.where(condition): # TypeError in Python3
#do something with "record"
我做错了什么?
【问题讨论】:
-
您是否尝试过改用
DataFrame.query方法?我不认为where接受字符串参数...
标签: python performance pytables