类似于此示例py-datatable 'in' 运算符?但使用另一个数据表创建列表,在最后一步失败:
import datatable as dt
from datatable import f, by, count
import operator
import functools
DT1 = dt.Frame(A = range(5))
DT2 = dt.Frame(B = range(3, 10))
sel_obs = DT2['B'].to_list()
filter_rows = functools.reduce(operator.or_,(f.A==obs for obs in sel_obs))
DT1[filter_rows,:]
但是出现错误:
TypeError:i-expression 评估为 7 列