[英]Replacing column of inf values with 0
我是numpy的新手,但我似乎無法讓這段代碼工作。
item3.apply(lambda x : (x[np.isneginf(x)] = 0))
item3是numpy數組的向量,每個數組中有300個維度。
拋出的錯誤是無效的語法。 我如何實現這個功能。
但是,鑒於它是float64 numpy向量的向量。 數據類型是object。 它會引發異常
TypeError: ufunc 'isinf' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
Item3是包含每個具有300維度的元素的列
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.