def subsample(X: np.ndarray, subsample: int=1, seed: int=0) -> Tuple[(np.ndarray, np.ndarray)]:
    '    Subsample a fraction of 1/subsample samples from the rows of X.\n\n    Parameters\n    ----------\n    X\n        Data array.\n    subsample\n        1/subsample is the fraction of data sampled, n = X.shape[0]/subsample.\n    seed\n        Seed for sampling.\n\n    Returns\n    -------\n    Xsampled\n        Subsampled X.\n    rows\n        Indices of rows that are stored in Xsampled.\n    '
    if ((subsample == 1) and (seed == 0)):
        return (X, np.arange(X.shape[0], dtype=int))
    if (seed == 0):
        rows = np.arange(0, X.shape[0], subsample, dtype=int)
        n = rows.size
        Xsampled = np.array(X[rows])
    else:
        if (seed < 0):
            raise ValueError(f'Invalid seed value < 0: {seed}')
        n = int((X.shape[0] / subsample))
        np.random.seed(seed)
        (Xsampled, rows) = subsample_n(X, n=n)
    logg.debug(f'... subsampled to {n} of {X.shape[0]} data points')
    return (Xsampled, rows)
Subsample a fraction of 1/subsample samples from the rows of X.

Parameters
----------
X
    Data array.
subsample
    1/subsample is the fraction of data sampled, n = X.shape[0]/subsample.
seed
    Seed for sampling.

Returns
-------
Xsampled
    Subsampled X.
rows
    Indices of rows that are stored in Xsampled.
def subsample(X: np.ndarray, subsample: int=1, seed: int=0) -> Tuple[(np.ndarray, np.ndarray)]:
    '    Subsample a fraction of 1/subsample samples from the rows of X.\n\n    Parameters\n    ----------\n    X\n        Data array.\n    subsample\n        1/subsample is the fraction of data sampled, n = X.shape[0]/subsample.\n    seed\n        Seed for sampling.\n\n    Returns\n    -------\n    Xsampled\n        Subsampled X.\n    rows\n        Indices of rows that are stored in Xsampled.\n    '
    if ((subsample == 1) and (seed == 0)):
        return (X, np.arange(X.shape[0], dtype=int))
    if (seed == 0):
        rows = np.arange(0, X.shape[0], subsample, dtype=int)
        n = rows.size
        Xsampled = np.array(X[rows])
    else:
        if (seed < 0):
            raise ValueError(f'Invalid seed value < 0: {seed}')
        n = int((X.shape[0] / subsample))
        np.random.seed(seed)
        (Xsampled, rows) = subsample_n(X, n=n)
    logg.debug(f'... subsampled to {n} of {X.shape[0]} data points')
    return (Xsampled, rows)