TypeError: 'numpy.ndarray' object is not callable
生活随笔
收集整理的這篇文章主要介紹了
TypeError: 'numpy.ndarray' object is not callable
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
取ndarray的某幾個(gè)數(shù),若寫為:
a = np.array([0,1,2,3,4,5,6]) index = np.array([1,2,3]) b = a(index) print(b)則會(huì)報(bào)錯(cuò)TypeError: 'numpy.ndarray' object is not callable
正確寫法為:
a = np.array([0,1,2,3,4,5,6]) index = np.array([1,2,3]) b = a[index] print(b)?
總結(jié)
以上是生活随笔為你收集整理的TypeError: 'numpy.ndarray' object is not callable的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: opencv2.4.9报错找不到open
- 下一篇: 神经网络中Batch和Epoch之间的区