有人能帮我解释一下更简单的逻辑吗?我已经挠头两天了。你知道吗
问题:-我有两个CSV文件。尝试建立父/子关系,直到关系耗尽b/w这两个文件。你知道吗
Assume, both the files have 2 columns A, B in 1st csv and C, D in second CSV.
"A" should be matched with "C" and for the matching rows [Inner Join], take the "D" and compare it with "B" [Again an inner join]. Then again, from the result, A should be matched against "C" till the relation or chain stops somewhere.
基本上,在我的问题中,B是D的孩子,B本身可能有另一个孩子。你知道吗
我不确定我说得很清楚
谢谢你主动帮忙。我已经创建了虚拟数据。请看是否有用
在两个csv文件中输入数据,如下所示
A B C D
310 9000 310 8000
320 8000 320 2000
330 2000 330 1000
340 1000 350 2500
在新文件或数据帧:-链停在1000,因为340在第二个csv中没有行。你知道吗
预期产量数据:-你知道吗
A B C D E F
1. 310 8000 320 2000 330 1000
据我所知,我认为这是你需要的:
合并dfs:
当B>;D时,假设D是B的子级:
将它们转换为系列:
相关问题 更多 >
编程相关推荐