[Mne_analysis] question about epochs.next()

Dan McCloy drmccloy at uw.edu
Tue Apr 5 15:03:52 EDT 2016
Search archives:

I was puzzled today why this works...

for ix, _ in enumerate(epochs):
    new_epoch = epochs[ix].crop(tmin, tmax, copy=True)

... but this does not:

for epoch in epochs:
    new_epoch = epoch.crop(..., copy=True)

AttributeError: 'numpy.ndarray' object has no attribute 'crop'

According to the docs, Epochs.next() is supposed to return an instance of
the epochs object, but it doesn't: looking at the code, it actually returns
something like self._data[self._current].  I would have expected it to
return something like self.__get_item__(self._current).  So are the docs
wrong, or is the definition of Epochs.next() implemented wrong?

Daniel McCloy
Postdoctoral Research Associate
Institute for Learning and Brain Sciences
University of Washington
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160405/5deac3a3/attachment.html 

More information about the Mne_analysis mailing list