'Resample data.
.. note:: Data must be loaded.
Parameters
sfreq : float
New sample rate to use
npad : int | str
Amount to pad the start and end of the data.
Can also be "auto" to use a padding that will result in
a power-of-two size (can be much faster).
window : string or tuple
Window to use in resampling. See :func:`scipy.signal.resample`.
n_jobs : int
Number of jobs to run in parallel.
verbose : bool, str, int, or None
If not None, override default verbose level (see
:func:`mne.verbose` :ref:`Logging documentation <tut_logging>` for
more). Defaults to self.verbose.
Returns
epochs : instance of Epochs
The resampled epochs object.
See Also
mne.Epochs.savgol_filter
mne.io.Raw.resample
Notes
For some data, it may be more accurate to use npad=0 to reduce
artifacts. This is dataset dependent -- check your data!'

@verbose
def resample(self, sfreq, npad='auto', window='boxcar', n_jobs=1, verbose=None):

    if (not self.preload):
        raise RuntimeError('Can    only    resample    preloaded    data')
    o_sfreq = self.info['sfreq']
    self._data = resample(self._data, sfreq, o_sfreq, npad, window=window, n_jobs=n_jobs)
    self.info['sfreq'] = float(sfreq)
    self.times = ((np.arange(self._data.shape[2], dtype=np.float) / sfreq) + self.times[0])
    self._raw_times = self.times
    return self
