我无法使代码看起来正常......
import numpy as np
test = np.zeros(3,2)
print(test[0])
---------------------------------------------------------------------------
TypeError
Traceback (most recent call last)
<ipython-input-35-81513f7c30bf> in <module>()
1 import numpy as np
----> 2 test = np.zeros(3,2)
3 print(test[0])
TypeError: data type not understood
答案 0 :(得分:1)
使形状成为元组:
test = np.zeros((3,2))
print(test[0])
输出:
[ 0. 0.]