0

我是熊猫新手。有什么办法可以将这两个数据框合并到以下结果中

数据框1:-

|-------------|---------|----------------------|-------|  
|Test Case    | SubTest | App                  | Count |  
| geekebench5 | OpenCL  | geekbench_x86_64.exe | 1.0   |  
| geekebench5 | OpenCL  | geekbench_x86_64.exe | 1.0   |  
| geekebench5 | Vulkan  | geekbench_x86_64.exe | 1.0   |  
| geekebench5 | cpu     | geekbench_x86_64.exe | 2.0   |  
| geekebench5 | cpu     | geekbench_x86_64.exe | 1.0   |  
| geekebench5 | cpu     | geekbench_x86_64.exe | 1.0   |  
| geekebench5 | cpu     | geekbench_x86_64.exe | 1.0   |  
| geekebench5 | cpu     | Process              | 1.0   |  
|-------------|---------|----------------------|-------|

数据帧2:-

|-------------|---------|----------------------|-------|  
|Test Case    | SubTest | App                  | Count |  
| geekebench5 | OpenCL  | geekbench_x86_64.exe | 2.0   |  
| geekebench5 | Vulkan  | geekbench_x86_64.exe | 1.0   |  
| geekebench5 | cpu     | geekbench_x86_64.exe | 2.0   |  
| geekebench5 | cpu     | geekbench_x86_64.exe | 1.0   |  
|-------------|---------|----------------------|-------|

数据帧结果:-

|-------------|---------|----------------------|---------|---------|  
|Test Case    | SubTest | App                  | Count_x | Count_y |  
| geekebench5 | OpenCL  | geekbench_x86_64.exe | 1.0     |  2.0    |  
| geekebench5 | OpenCL  | geekbench_x86_64.exe | 1.0     |  NaN    |  
| geekebench5 | Vulkan  | geekbench_x86_64.exe | 1.0     |  1.0    |  
| geekebench5 | cpu     | geekbench_x86_64.exe | 2.0     |  2.0    |  
| geekebench5 | cpu     | geekbench_x86_64.exe | 1.0     |  1.0    |  
| geekebench5 | cpu     | geekbench_x86_64.exe | 1.0     |  NaN    |  
| geekebench5 | cpu     | geekbench_x86_64.exe | 1.0     |  NaN    |  
| geekebench5 | cpu     | Process              | 1.0     |  NaN    |  
|-------------|---------|----------------------|---------|---------|

使用左操作合并没有帮助。行数增加,而不是NaN,它输入前一行值

4

0 回答 0