python-2.7 - 我必须删除 Python 数据框中列中的最后一个数字和字符?
问题描述
我有一列具有这样的值:34343434,4
和223232,5
.
我想删除最后一个数字和字符,
,并期待这样:34343434
223232
。
我尝试使用此代码:
dataframe['column name'] = pd.to_numeric(dataframe['column name']).astype.float().round(0, 2)
但它没有用。有人可以帮我得到我想要的输出吗?
解决方案
推荐阅读
- python - python - 从 python 脚本启动的跟踪进程
- android - Android Paint.setStrokeCap(Paint.Cap.ROUND) 性能问题
- macos - 禁用 Jupyter Notebook 单元格搜索
- android - 如何将套接字移动扫描仪与 android 应用程序集成并检索结果
- bash - 从环境变量展开变量集
- arrays - 这个使用范围的简单 For 循环如何以及为什么在 Go 中打印一个简单的 3D 数组?
- json - Applescript JSON 提取
- regex - Selenium IDE - 如何将正则表达式与命令“断言文本”一起使用?
- c++ - Change in number of button cause alignment issue in WxWidgets for Windows
- .net - HttpClient not responding correctly to FIN, PSH, ACK from web server? Leads to TaskCanceledException