Reputation: 55
I could not make the code look normal...
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
Upvotes: 1
Views: 28
Reputation: 85442
Make the shape a tuple:
test = np.zeros((3,2))
print(test[0])
Output:
[ 0. 0.]
Upvotes: 1