我有一个数字列,可以包含不同形式[0-9]的其他字符.说:x = pandas.Series(["1","1.2", "*", "1", "**."]).然后我想使用将该系列转换为数字列x.astype(dtype = float, errors = 'ignore').我无法弄清楚为什么熊猫不断给我一个错误,尽管我不让他这样做!我的代码有问题吗?
x = pandas.Series(["1","1.2", "*", "1", "**."])
x.astype(dtype = float, errors = 'ignore')
pandas
pandas ×1