pandas 给某一列添加字符串或者添加新的列

即可!

添加新的列:

data['m'] = data['code'].str[:4]

原文地址:https://www.cnblogs.com/yu121/p/12970262.html