markov_clustering icon indicating copy to clipboard operation
markov_clustering copied to clipboard

Shape mismatch in assignment

Open krishdb38 opened this issue 5 years ago • 0 comments


ValueError Traceback (most recent call last) in ----> 1 result = mc.run_mcl(matrix) # run MCL with default parameters 2 clusters = mc.get_clusters(result) # get clusters

~\Anaconda3\lib\site-packages\markov_clustering\mcl.py in run_mcl(matrix, expansion, inflation, loop_value, iterations, pruning_threshold, pruning_frequency, convergence_check_frequency, verbose) 231 if pruning_threshold > 0 and i % pruning_frequency == pruning_frequency - 1: 232 printer.print("Pruning") --> 233 matrix = prune(matrix, pruning_threshold) 234 235 # Check for convergence

~\Anaconda3\lib\site-packages\markov_clustering\mcl.py in prune(matrix, threshold) 91 if isspmatrix(matrix): 92 pruned = dok_matrix(matrix.shape) ---> 93 pruned[matrix >= threshold] = matrix[matrix >= threshold] 94 pruned = pruned.tocsc() 95 else:

~\Anaconda3\lib\site-packages\scipy\sparse_index.py in setitem(self, key, x) 122 x, _ = _broadcast_arrays(x, i) 123 if x.shape != i.shape: --> 124 raise ValueError("shape mismatch in assignment") 125 if x.size == 0: 126 return

ValueError: shape mismatch in assignment

krishdb38 avatar Mar 13 '20 01:03 krishdb38