AttributeError: 'Series' object has no attribute 'convert_objects'

今天在编程时python出现这个错误,下面是出错代码,作用是转换类型。

df.runtime = df.runtime.convert_objects(convert_numeric=True)
出错原因好像是因为pycharm版本原因,上面的类型转换方式被弃用了。
换成下面的代码就行了
df.runtime = pd.to_numeric(df.runtime)
 
posted @ 2021-12-14 21:44  Ryuuko-  阅读(1429)  评论(0)    收藏  举报