import numpy as np n_mat = np.zeros(20, 20)
Then, an error occurs.
1 import numpy as np ----> 2 n_mat = np.zeros(20, 20) TypeError: data type not understood
This can be avoided by doing the following.
import numpy as np n_mat = np.zeros((20, 20))
In other words, the zeros argument must be entered in tuple format, not comma separated. It's a really useless article, but as a former MATLAB user, I was worried about this for about 5 minutes, so I will record it as a commandment.