def subsample_n(X: np.ndarray, n: int=0, seed: int=0) -> Tuple[(np.ndarray, np.ndarray)]:
    'Subsample n samples from rows of array.\n\n    Parameters\n    ----------\n    X\n        Data array.\n    n\n        Sample size.\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 (n < 0):
        raise ValueError('n must be greater 0')
    np.random.seed(seed)
    n = (X.shape[0] if ((n == 0) or (n > X.shape[0])) else n)
    rows = np.random.choice(X.shape[0], size=n, replace=False)
    Xsampled = X[rows]
    return (Xsampled, rows)
Subsample n samples from rows of array.

Parameters
----------
X
    Data array.
n
    Sample size.
seed
    Seed for sampling.

Returns
-------
Xsampled
    Subsampled X.
rows
    Indices of rows that are stored in Xsampled.
def subsample_n(X: np.ndarray, n: int=0, seed: int=0) -> Tuple[(np.ndarray, np.ndarray)]:
    'Subsample n samples from rows of array.\n\n    Parameters\n    ----------\n    X\n        Data array.\n    n\n        Sample size.\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 (n < 0):
        raise ValueError('n must be greater 0')
    np.random.seed(seed)
    n = (X.shape[0] if ((n == 0) or (n > X.shape[0])) else n)
    rows = np.random.choice(X.shape[0], size=n, replace=False)
    Xsampled = X[rows]
    return (Xsampled, rows)