def METHOD_NAME(self, X, y=None):
    """Transform X and return a transformed version.
    private _transform containing core logic, called from transform
    Parameters
    ----------
    X : nested pandas DataFrame of shape [n_instances, n_features]
        each cell of X must contain pandas.Series
        Data to fit transform to
    y : ignored argument for interface compatibility
        Additional data, e.g., labels for transformation
    Returns
    -------
    Xt : nested pandas DataFrame of shape [n_instances, n_features]
        each cell of Xt contains pandas.Series
        transformed version of X
    """
    # Get information about the dataframe
    n_timepoints = len(X.iloc[0, 0])
    num_instances = X.shape[0]
    col_names = X.columns
    self._check_parameters(n_timepoints)
    Xt = pd.DataFrame()
    for x in col_names:
        # Convert one of the columns in the dataframe to numpy array
        arr = convert(
            pd.DataFrame(X[x]),
            from_type="nested_univ",
            to_type="numpyflat",
            as_scitype="Panel",
        )
        # Calculate gradients
        transformedData = []
        for y in range(num_instances):
            res = self._get_gradients_of_lines(arr[y])
            transformedData.append(res)
        # Convert to Numpy array
        transformedData = np.asarray(transformedData)
        # Add it to the dataframe
        colToAdd = []
        for i in range(len(transformedData)):
            inst = transformedData[i]
            colToAdd.append(pd.Series(inst))
        Xt[x] = colToAdd
    return Xt