def shuffle_in_unison(a, b):
    rng_state = np.random.get_state()
    np.random.shuffle(a)
    np.random.set_state(rng_state)
    np.random.shuffle(b)
Python 2 version
dataset/ETHPy150Open kastnerkyle/PyCon2015/matrix_factorization.py/shuffle_in_unison--crossover with--dataset/ETHPy150Open RDFLib/rdfextras/rdfextras/py3compat.py/format_doctest_out