繁体   English   中英

无法理解 StringDtype 数据类型

[英]StringDtype data type not understood

从扩展类型转换时,例如pd.Int32Dtype() ,我得到TypeError: data type not understood pd.Int32Dtype() 例子:

num_col_with_nan = num_col_with_nan.astype(pd.Int32Dtype()).astype("string")

尚不支持扩展类型之间的转换 - 请参阅#22384了解一般概述,特别是#31204了解 StringDtype。

作为解决方法,请先尝试强制转换为 str:

num_col_with_nan = num_col_with_nan.astype(pd.Int32Dtype()).astype(str).astype("string")

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM