demo_python_numpy_array_reshape_error.py:
x
 
import numpy as np
arr = np.array([1, 2, 3, 4, 5, 6, 7, 8])
newarr = arr.reshape(3, 3)
print(newarr)
C:\Users\My Name>python demo_python_numpy_array_reshape_error.py
Traceback (most recent call last):
  File "demo_python_numpy_array_reshape_error.py", line 5, in <module>
ValueError: cannot reshape array of size 8 into shape (3,3)