0
我有數據幀,看起來像:在不同的列數據框替換字符串值
Tester Type Subject Type Time 1 2 3
TType1 SType1 Day 1 11 2 1
TType1 SType2 Day 1 3 2 13
TType1 SType1 Day 2 2 3 15
TType2 SType3 Day 2 1 4 3
TType3 SType3 Day 2 2 3 4
TType1 SType1 Day 1 7 2 2
TType2 SType1 Day 2 2 6 7
我試圖找到所有S型1主體類型柱上,並用測試儀類型值替換它。所以,我的輸出看起來像:
Tester Type Subject Type Time 1 2 3
TType1 TType1 Day 1 11 2 1
TType1 SType2 Day 1 3 2 13
TType1 TType1 Day 2 2 3 15
TType2 SType3 Day 2 1 4 3
TType3 SType3 Day 2 2 3 4
TType1 TType1 Day 1 7 2 2
TType2 TType2 Day 2 2 6 7
到目前爲止您嘗試了什麼?這個網站上有很多資源來執行這樣的操作。 –
[將列中的值替換爲來自同一數據框中另一列的對應值]可能的重複(http://stackoverflow.com/questions/22814515/replace-value-in-column-with-corresponding-value-from-another-列在同一dat) – Alex
嘗試http://stackoverflow.com/questions/22814515/replace-value-in-column-with-corresponding-value-from-another-column-in-same-dat?rq= 1 – Alex