簡體   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