(X, overlap=False, indices=None)
return means, stds
Compute mean and standard deviation for each channel.

    Parameters
    ----------
    X : np.ndarray
        Full features array of shape `(n_samples, n_channels, lookback, n_assets)`.

    overlap : bool
        If False, then only using the most recent timestep. This will guarantee that not counting
        the same thing multiple times.

    indices : list or None
        List of indices to consider from the `X.shape[0]` dimension. If None
        then considering all the samples.

    Returns
    -------
    means : np.ndarray
        Mean of each channel. Shape `(n_channels,)`.

    stds : np.ndarray
        Standard deviation of each channel. Shape `(n_channels,)`.
Compute mean and standard deviation for each channel.
Compute mean and standard deviation for each channel .
def prepare_standard_scaler(X, overlap=False, indices=None):
    """Compute mean and standard deviation for each channel.

    Parameters
    ----------
    X : np.ndarray
        Full features array of shape `(n_samples, n_channels, lookback, n_assets)`.

    overlap : bool
        If False, then only using the most recent timestep. This will guarantee that not counting
        the same thing multiple times.

    indices : list or None
        List of indices to consider from the `X.shape[0]` dimension. If None
        then considering all the samples.

    Returns
    -------
    means : np.ndarray
        Mean of each channel. Shape `(n_channels,)`.

    stds : np.ndarray
        Standard deviation of each channel. Shape `(n_channels,)`.

    """
    indices = indices if indices is not None else list(range(len(X)))
    considered_values = X[indices, ...] if overlap else X[indices, :, -1:, :]

    means = considered_values.mean(axis=(0, 2, 3))
    stds = considered_values.std(axis=(0, 2, 3))

    return means, stds
def prepare_standard_scaler ( X , overlap = False , indices = None ) : indices = indices if indices is not None else list ( range ( len ( X ) ) ) considered_values = X [ indices , ... ] if overlap else X [ indices , : , - 1 : , : ] means = considered_values . mean ( axis = ( 0 , 2 , 3 ) ) stds = considered_values . std ( axis = ( 0 , 2 , 3 ) ) return means , stds