2
我有下面的「raw_input」數據框。如果你看一下「摘要」欄。有一個 分隔符「:」,我想上創建兩個附加列,並添加到現有的數據幀在分隔符上分割一個Dataframe列並保留所有其他列
我想是「摘要」一欄分爲兩列(「工作 包」和'任務')
我可以使用下面的命令拆分分隔符。但我不知道如何添加/把它合併到現有的數據幀
split_data = pd.DataFrame(raw_input['Summary'].str.split(':',1).tolist(),columns=['Work Package','Task'])
print(raw_input)
Key Summary Status Description Updated
0 XTBOW-310 Data Mgmt: Product Assesment and Selection In Analysis - To establish a provider for the solution of ... 2017-05-26
1 XTBOW-420 Data Mgmt: Vendor > CIBC Implemention NaN - Integrate with Vendor to fetch Corporate Act... 2017-05-19
2 XTBOW-421 Trade Migration: PVs and Greeks NaN - PVs and Greeks regression gap analysis betwe... 2017-05-19
3 XTBOW-422 Trade Migration: Reports (XTC vs XT2) NaN NaN 2017-05-19
print(split_data)
Work Package Task
0 Data Mgmt Product Assesment and Selection
1 Data Mgmt Vendor > CIBC Implemention
2 Trade Migration PVs and Greeks
3 Trade Migration Reports (XTC vs XT2)
的raw_input'= pd.concat([的raw_input,split_data]軸= 1)' –
謝謝!正是我需要的 – Karun