【发布时间】:2019-12-28 17:09:13
【问题描述】:
我有下面的代码从两个不同的表中捕获数据,比较两个结果并获得输出。
EmplTbl = cur.execute("select A , B , C from EmployeeTable where EmplName in ('A','B')")
emp_entries = set(cur)
DeptTbl = cur.execute("select A , B , C from DeptTable")
dept_entries = set(cur)
print(emp_entries.difference(dept_entries))
下面是我收到的输出
Output:
{(1, A, X),(2, B, Y),(3, B, Y)}
当我试图将它分配给数据框时,我得到“'dict' object has no attribute 'append'” 如何使用 A、B、C 列或任何其他方式将上述“数据”分配到正确的数据框中。
预期输出:
A, B, C
1, A, X
2, B, Y
3, B, Y
【问题讨论】:
标签: python pandas oracle list dataframe