我有两个Pandas数据帧:
In: df_Rq
Out:
EH Req SH Req SD Req
0 EH-01 HL-02
1 EH-01 HL-03 SH-02
2 EH-01 HL-03 SH-03
3 EH-01 HL-03 SH-04
4 EH-01 HL-03 SH-05
In: df_TC
Out:
Test Case Description
0 TC00 Default
1 TC01 Test 1
2 TC02 Test 2
每个测试用例都支持每个需求数据框,因此我需要扩展df_Rq中的每一行以包含测试用例。像这样:
In: df_Pro
Out:
EH Req SH Req SD Req Test Case Description
0 EH-01 HL-02 TC00 Default
1 EH-01 HL-02 TC01 Test 1
2 EH-01 HL-02 TC02 Test 2
3 EH-01 HL-03 SH-02 TC00 Default
4 EH-01 HL-03 SH-02 TC01 Test 1
5 EH-01 HL-03 SH-02 TC02 Test 2
6 EH-01 HL-03 SH-03 TC00 Default
7 EH-01 HL-03 SH-03 TC01 Test 1
8 EH-01 HL-03 SH-03 TC02 Test 2
9 EH-01 HL-03 SH-04 TC00 Default
10 EH-01 HL-03 SH-04 TC01 Test 1
11 EH-01 HL-03 SH-04 TC02 Test 2
12 EH-01 HL-03 SH-05 TC00 Default
13 EH-01 HL-03 SH-05 TC01 Test 1
14 EH-01 HL-03 SH-05 TC02 Test 2
我尝试过各种for循环,追加,合并命令。怎么会这样做?