def METHOD_NAME(self, X, y=None):
    """Transform data.
    Parameters
    ----------
    X : nested pandas DataFrame of shape [n_instances, 1]
        Nested dataframe with univariate time-series in cells.
    Returns
    -------
    dims: Pandas data frame with first dimension in column zero
    """
    X = X.squeeze(1)
    if self.alphabet_size < 2 or self.alphabet_size > 4:
        raise RuntimeError("Alphabet size must be an integer between 2 and 4")
    if self.word_length < 1 or self.word_length > 16:
        raise RuntimeError("Word length must be an integer between 1 and 16")
    breakpoints = self._generate_breakpoints()
    n_instances, series_length = X.shape
    bags = pd.DataFrame()
    dim = []
    for i in range(n_instances):
        bag = {}
        lastWord = -1
        words = []
        num_windows_per_inst = series_length - self.window_size + 1
        split = np.array(
            X[
                i,
                np.arange(self.window_size)[None, :]
                + np.arange(num_windows_per_inst)[:, None],
            ]
        )
        split = scipy.stats.zscore(split, axis=1)
        paa = PAA(num_intervals=self.word_length)
        data = pd.DataFrame()
        data[0] = [pd.Series(x, dtype=np.float32) for x in split]
        patterns = paa.fit_transform(data)
        patterns = np.asarray([a.values for a in patterns.iloc[:, 0]])
        for n in range(patterns.shape[0]):
            pattern = patterns[n, :]
            word = self._create_word(pattern, breakpoints)
            words.append(word)
            lastWord = self._add_to_bag(bag, word, lastWord)
        if self.save_words:
            self.words.append(words)
        dim.append(pd.Series(bag) if self.return_pandas_data_series else bag)
    bags[0] = dim
    return bags