[med-svn] [python-mne] 293/353: made return of idx in bootstrap optional

Yaroslav Halchenko debian at onerussian.com
Fri Nov 27 17:25:18 UTC 2015


This is an automated email from the git hooks/post-receive script.

yoh pushed a commit to tag 0.4
in repository python-mne.

commit f03d078a4c11a0f42ef6541ca537861c21db826c
Author: Daniel Strohmeier <daniel.strohmeier at googlemail.com>
Date:   Wed Jul 18 16:00:42 2012 +0200

    made return of idx in bootstrap optional
---
 mne/epochs.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/mne/epochs.py b/mne/epochs.py
index ceb9618..dc6662f 100644
--- a/mne/epochs.py
+++ b/mne/epochs.py
@@ -514,15 +514,17 @@ def _is_good(e, ch_names, channel_type_idx, reject, flat):
     return True
 
 
-def bootstrap(epochs, rng):
+def bootstrap(epochs, rng, return_idx=False):
     """Compute average of epochs selected by bootstrapping
 
     Parameters
     ----------
     epochs : Epochs instance
         epochs data to be bootstrapped
-    rng: 
+    rng : 
         random number generator.
+    return_idx : bool
+        If True the selected indices are provided as an output
 
     Returns
     -------
@@ -538,4 +540,7 @@ def bootstrap(epochs, rng):
     n_events = len(epochs_bootstrap.events)
     idx = rng.randint(0, n_events, n_events)
     epochs_bootstrap = epochs_bootstrap[idx]
-    return epochs_bootstrap, idx
+    if output_idx:
+        return epochs_bootstrap, idx
+    else:
+        return epochs_bootstrap

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/python-mne.git



More information about the debian-med-commit mailing list