【Python】AttributeError: module ‘numpy’ has no attribute ‘unit8’ 的解决方法
生活随笔
收集整理的這篇文章主要介紹了
【Python】AttributeError: module ‘numpy’ has no attribute ‘unit8’ 的解决方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
經排查,下面的一行代碼出了異常:
mask2 = np.where((mask1 == 2) | (mask1 == 0), 0, 1).astype('unit8')異常類型是:
AttributeError: module ‘numpy’ has no attribute ‘unit8’
無非就是uint8寫成了unit8。
這個錯誤其實還算挺low的,但也不是不可能出現。
希望別手抖或是慣性思維吧,加油。
總結
以上是生活随笔為你收集整理的【Python】AttributeError: module ‘numpy’ has no attribute ‘unit8’ 的解决方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【离散数学】二部图
- 下一篇: websocket python爬虫_p