【发布时间】:2020-11-02 20:35:58
【问题描述】:
我已经写了下面的代码,但它给了我这个error"ValueError: Type of input is not string! 请输入一个有效的数字字(例如'200万23049')"
df.experience = df.experience.apply(w2n.word_to_num)
【问题讨论】:
-
我的数据集有像“零、一、二”这样的数据我想要像“1、2、3”这样的数据
-
问题可能出在您的数据集中。它是如何准确表示的?请编辑您的帖子。以下代码对我来说很好用:
df = pd.DataFrame({"experience":['five', 'two', 'seven']}) df.experience = df.experience.apply(w2n.word_to_num)所以问题不在你的应用行 -
是的。这个问题在我的数据集中,我解决了。谢谢你的回答。
标签: python-3.x pandas jupyter-notebook