netneurolab / netneurotools

Useful tools from the Network Neuroscience Lab
https://netneurolab.github.io/netneurotools
BSD 3-Clause "New" or "Revised" License
61 stars 32 forks source link

[FIX] np.nanmean in func consensus when no boot #79

Closed VinceBaz closed 4 years ago

VinceBaz commented 4 years ago

Changed np.mean() to np.nanmean() in func_consensus() function, when the consensus matrix is computed without any bootstrap.

This change is useful for a few cases where an individual subject has no BOLD signal data for an individual node (0s at every time point). When this happen, you don't want to completely ignore the subject, but you want to ignore the NaN correlations that np.corrcoef will return for pairwise correlations with this node.

Example: Subject 39, node 113 in func_scale500.npy file

codecov-io commented 4 years ago

Codecov Report

Merging #79 into master will not change coverage by %. The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #79   +/-   ##
=======================================
  Coverage   63.61%   63.61%           
=======================================
  Files          22       22           
  Lines        1509     1509           
=======================================
  Hits          960      960           
  Misses        549      549           
Impacted Files Coverage Δ
netneurotools/networks.py 9.34% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 519ffc7...d2d40b4. Read the comment docs.

rmarkello commented 4 years ago

Agreed, this makes sense to me!

Thanks for the change 🙌