前言
本文的文字及圖片來源于網路,僅供學習、交流使用,不具有任何商業用途,著作權歸原作者所有,如有問題請及時聯系我們以作處理,
作者:周穎
TypeError: unsupported operand type(s) for ^: 'float' and 'int'
解決辦法:把乘方號^改成了**
參考https://stackoverflow.com/questions/34258537/python-typeerror-unsupported-operand-types-for-float-and-int
TypeError: type numpy.ndarray doesn't define __round__ method
解決辦法:把round()改成np.round()
TypeError: ufunc 'bitwise_xor' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
解決方法:^改成**
TypeError: only size-1 arrays can be converted to Python scalars
解決辦法:把math.exp改成np.exp()
原因:sigma是numpy 的矩陣,要用numpy.exp處理
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/65169.html
標籤:Python
