我想使用DolphinDB中的intersection()函数,返回两个集合的交集。
代码如下:
login("admin","123456")
n=1000000
ID=rand(100, n)
dates=2017.08.07..2017.08.11
date=rand(dates, n)
x=rand(10.0, n)
t=table(ID, date, x)
if(existsDatabase("dfs://compodb")){
dropDatabase("dfs://compodb")
}
dbDate = database(, VALUE, 2017.08.07..2017.09.11)
dbID = database(, RANGE, 0 50 100)
db = database("dfs://compodb", COMPO, [dbDate, dbID])
pt = db.createPartitionedTable(t, `pt, `date`ID)
pt.append!(t)
dfsTable=loadTable("dfs://compodb","pt")
A = select * from dfsTable where date = 2017.08.07
B = select * from dfsTable where date = 2017.08.08
intersection(A[`x],B[`x])
返回如下错误:
The both arguments for 'bitAnd'(&) must be integers
请问哪里不对?
intersection(X, Y)的参数X和Y须是集合: