成功解决AttributeError: 'list' object has no attribute 'shape'
生活随笔
收集整理的這篇文章主要介紹了
成功解决AttributeError: 'list' object has no attribute 'shape'
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
成功解決AttributeError: 'list' object has no attribute 'shape'
?
?
目錄
解決問題
解決思路
解決方法
?
?
?
?
?
?
?
解決問題
AttributeError: 'list' object has no attribute 'shape'
?
解決思路
屬性錯誤:“list”對象沒有屬性“shape”
?
解決方法
經常使用numpy庫的會知道,np.array可使用 shape。而對于列表list,卻不能使用shape來查看列表的維度。如果非要想查看列表維度,可以采用:
T1、將列表轉為array格式,然后使用shape即可!
list_shape = np.array(list_01).shape
print(list_shape)
總結
以上是生活随笔為你收集整理的成功解决AttributeError: 'list' object has no attribute 'shape'的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Python语言学习:Python随机生
- 下一篇: 成功解决mxnet-tag\mxnet\