Skip to content

Commit

Permalink
Avoid ValueError in bct.modularity_dir with latest numpy version
Browse files Browse the repository at this point in the history
`ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (3,) + inhomogeneous part.`
  • Loading branch information
liadomide committed May 7, 2023
1 parent 3200834 commit 73e3796
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bct/algorithms/modularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def ls2ci(ls, zeroindexed=False):
ci : Nx1 np.ndarray
community index vector
'''
if ls is None or np.size(ls) == 0:
if ls is None or len(ls) == 0:
return () # list is empty
nr_indices = sum(map(len, ls))
ci = np.zeros((nr_indices,), dtype=int)
Expand Down

0 comments on commit 73e3796

Please sign in to comment.