brainstorm/tools.py
def shuffle_data(*args, **kwargs):
    """
    Shuffle numpy arrays along the second dimension.

    Args:
        *args (numpy.ndarray):
            arrays to be shuffled.
        seed (Optional[int]):
            seed to make the shuffle reproducible
    Returns:
        list[numpy.ndarray]:
            list of shuffled arrays

    """
    rnd = np.random.RandomState(kwargs.get('seed', None))
    idxs = np.arange(args[0].shape[1])
    rnd.shuffle(idxs)
    return [None if A is None else A[:, idxs] for A in args]

    Shuffle numpy arrays along the second dimension.

    Args:
        *args (numpy.ndarray):
            arrays to be shuffled.
        seed (Optional[int]):
            seed to make the shuffle reproducible
    Returns:
        list[numpy.ndarray]:
            list of shuffled arrays

    
Shuffle numpy arrays along the second dimension.
Shuffle numpy arrays along the second dimension .
def shuffle_data(*args, **kwargs):
    rnd = np.random.RandomState(kwargs.get('seed', None))
    idxs = np.arange(args[0].shape[1])
    rnd.shuffle(idxs)
    return [None if A is None else A[:, idxs] for A in args]
def shuffle_data ( * args , ** kwargs ) : rnd = np . random . RandomState ( kwargs . get ( 'seed' , None ) ) idxs = np . arange ( args [ 0 ] . shape [ 1 ] ) rnd . shuffle ( idxs ) return [ None if A is None else A [ : , idxs ] for A in args ]
Shuffle numpy arrays along the second dimension.
Shuffle numpy arrays along the second dimension .
"""
    Shuffle numpy arrays along the second dimension.

    Args:
        *args (numpy.ndarray):
            arrays to be shuffled.
        seed (Optional[int]):
            seed to make the shuffle reproducible
    Returns:
        list[numpy.ndarray]:
            list of shuffled arrays

    """
list of shuffled arrays
list of shuffled arrays
list[numpy.ndarray]
*args
arrays to be shuffled.
arrays to be shuffled .
seed
seed to make the shuffle reproducible
seed to make the shuffle reproducible