반응형
data type not understood
I'm trying to use a matrix to compute stuff. The code is this
import numpy as np
# some code
mmatrix = np.zeros(nrows, ncols)
print mmatrix[0, 0]
but I get 'data type not understood', and it works if I do it from terminal.
Try:
mmatrix = np.zeros((nrows, ncols))
Since the shape parameter has to be an int or sequence of ints
http://docs.scipy.org/doc/numpy/reference/generated/numpy.zeros.html
Otherwise you are passing ncols
to np.zeros
as the dtype.
참고URL : https://stackoverflow.com/questions/5446522/data-type-not-understood
반응형
'Development Tip' 카테고리의 다른 글
Are FP and OO orthogonal? (0) | 2020.10.21 |
---|---|
Rounded table corners CSS only (0) | 2020.10.21 |
SQL 'like' vs '=' performance (0) | 2020.10.21 |
Spread load evenly by using ‘H * * * *’ rather than ‘5 * * * *’ (0) | 2020.10.21 |
Spring Boot Test ignores logging.level (0) | 2020.10.21 |