如何解决:AttributeError:' generator'对象没有属性  ' ndim'

时间:2018-04-25 09:18:08

标签: python scipy sparse-matrix

我对此代码有疑问:

File "/Users/Sofia/Desktop/2d.py", line 102, in fromcmaptocoords
L = get_lap(C)

File "/Users/Sofia/Desktop/2d.py", line 96, in get_lap
 return scipy.sparse.csc_matrix(csgraph.laplacian(cmap, normed=False))

File "/anaconda3/lib/python3.6/site-packages/scipy/sparse/csgraph/_laplacian.py",
line 69, in laplacian if csgraph.ndim != 2 or csgraph.shape[0] != csgraph.shape[1]:

AttributeError: 'generator' object has no attribute 'ndim'

我收到以下错误:

$test = Array (
           Array(
         fileUploadFileErrorNoFile => 'File was not uploaded' ,
         fileMimeTypeNotReadable => 'File is not readable or does not exist',
         fileIsImageNotReadable => 'File is not readable or does not exist', 
         fileImageSizeNotReadable => 'File is not readable or does not exist'
         )
    );
你可以帮我这个吗?我不知道我需要改变什么 谢谢

0 个答案:

没有答案