1

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

1 Answer 1

1

Make the shape a tuple:

test = np.zeros((3,2))
print(test[0])

Output:

[ 0.  0.]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.