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