我有两个数据源-一个来自数据库,另一个来自CSV文件。数据库就像一把钥匙。你知道吗
从CSV文件包含多个字段
Id firstname lastname
1 first1 last1
2 first2 last2
3 first3 last3
我希望对Pandas执行与SQL相同的操作:
select * from adr_tmp where id in(select id from xyz where key = ‘x’);
或者
delete from adr_tmp where id in(select id from xyz where key = ‘x’);
在此之后,我应该有一个新的数据帧与
Id firstname lastname
1 first1 last1
2 first2 last2
不是很难,你可以试试:
这将返回adr\ U temp的所有字段,其中“id”位于xyz的“id”列表中,其中“key”=“x”
对于“删除”,您只需选择上面的补充项:
相关问题 更多 >
编程相关推荐