In: df['amount'].apply(locale.atof)
Out: ValueError: could not convert string to float: ' - ' 现在我知道列表中有非数字值,我尝试使用isnumeric方法将非数字值转换为NaN。不幸的是,由于逗号分隔的结构,所有的值都会变成-1。“首先去掉"-“值?我尝试了.drop()或.truncate,但没有任何帮助
但是,我想将列Value转换为D类型"double“,其中点作为小数分隔符。问题是,该列的值由于存在太多逗号(例如,0,1,)或替换了太多的点(例如0.1.)而产生噪声。因此,当我尝试将Dtype转换为double时,我会得到错误消息:could not convert string to float: '0.2.'示例代码:import pandas as pd
# ini