[Mne_analysis] question about epochs.next()
choldgraf at berkeley.edu
Tue Apr 5 15:19:34 EDT 2016
I've used iteration vs. indexing in different points in my codebase since
sometimes it's more useful to return arrays. But I agree, looking at the
docs it seems that `next` should return an instance of Epochs.
On Tue, Apr 5, 2016 at 12:03 PM, Dan McCloy <drmccloy at uw.edu> wrote:
> 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
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> The information in this e-mail is intended only for the person to whom it
> addressed. If you believe this e-mail was sent to you in error and the
> contains patient information, please contact the Partners Compliance
> HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to you in
> but does not contain patient information, please contact the sender and
> dispose of the e-mail.
PhD Candidate in Neuroscience | UC Berkeley <http://hwni.org/>
Editor and Web Director | Berkeley Science Review
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mne_analysis