scipy - numpy.sum() gives `TypeError: sum() got an unexpected keyword argument 'dtype'` -
scipy - numpy.sum() gives `TypeError: sum() got an unexpected keyword argument 'dtype'` -
the next code generated unexpected typeerror:
import scipy.sparse import numpy coomatrix = scipy.sparse.coo_matrix((100,100)) numpy.sum(coomatrix) the result:
typeerror: sum() got unexpected keyword argument 'dtype' scipy version 0.14.0, numpy version 1.9.0
the problem numpy.sum doesn't know how handle sparse matrices. next works expected:
coomatrix.sum() numpy scipy sparse-matrix
Comments
Post a Comment