如何将字符串添加到 Pandas DataFrame 列中的所有值?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42273937/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 02:59:46 来源:igfitidea点击:
How to add string to all values in a column of pandas DataFrame?
提问by mystery man
Say you have a DataFrame
with columns;
假设你有一个DataFrame
列;
col_1 col_2
1 a
2 b
3 c
4 d
5 e
how would you change the values of col_2
so that, new value= current value+ 'new'
您将如何更改的值,col_2
以便新值=当前值+'new'