我有一个表格1,其中包含以下格式的每一行:
collection.aggregate([{'$sample': {'size': sample_size }}])
另一个表2包含格式为的键值对:
<ID> <Key1> OR <Key2> OR <Key3> OR <Key4>
我想在表1中查找每个表,并用表2中的相应表替换。两个表中的行数> 30K 您会建议在列之间查找数据的最佳方法是什么? 这些表位于Excel中,但我正在寻找任何工具的指导
答案 0 :(得分:0)
我当然不是R专家,但您只是进行拆分和合并?或者是简化过程?
X <- split(df, df$g)
str(X)
Inner join: merge(df1, df2)
Outer join: merge(x = df1, y = df2, by = "CustomerId", all = TRUE)
Left outer: merge(x = df1, y = df2, by = "CustomerId", all.x = TRUE)
Right outer: merge(x = df1, y = df2, by = "CustomerId", all.y = TRUE)
Cross join: merge(x = df1, y = df2, by = NULL)