netneurolab / netneurotools

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

[ENH] Updates stats.efficient_pearsonr to handle NaNs #91

Closed rmarkello closed 3 years ago

rmarkello commented 3 years ago

Adds functionality to netneurotools.stats.efficient_pearsonr() such that it can handle NaN values in either (or both) of the inputs. The nan_policy parameter is adapted from scipy.stats mechanics; when set to 'omit' it will ignore the NaN values in both arrays and compute the correlation with the relevant entries excluded.

To Do:

codecov-io commented 3 years ago

Codecov Report

Merging #91 (caca281) into master (c0b4ce8) will decrease coverage by 0.31%. The diff coverage is 52.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #91      +/-   ##
==========================================
- Coverage   64.59%   64.27%   -0.32%     
==========================================
  Files          23       22       -1     
  Lines        1590     1601      +11     
==========================================
+ Hits         1027     1029       +2     
- Misses        563      572       +9     
Impacted Files Coverage Δ
netneurotools/__init__.py 100.00% <ø> (ø)
netneurotools/modularity.py 59.55% <ø> (ø)
netneurotools/plotting.py 6.57% <0.00%> (-0.06%) :arrow_down:
netneurotools/stats.py 78.39% <58.82%> (-2.26%) :arrow_down:
netneurotools/tests/test_stats.py 100.00% <0.00%> (ø)
netneurotools/tests/test_utils.py 100.00% <0.00%> (ø)
netneurotools/tests/test_cluster.py 100.00% <0.00%> (ø)
netneurotools/tests/test_freesurfer.py 100.00% <0.00%> (ø)
netneurotools/tests/test_datasets.py 98.71% <0.00%> (+0.12%) :arrow_up:

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 38add68...bc63e79. Read the comment docs.