contact2 = contact1['合同经办人'].str.split('--', expand=True)
我之前把“合同经办人”列分列了,对分列后的第2列直接赋值到新的”经办人名称“列,出了个警告,请问是什么原因,怎么解决,谢谢
SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
contact1.loc[:,'经办人名称'] = contact2[1]