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)
http://stackoverflow.com/questions/4601373/better-way-to-shuffle-two-numpy-arrays-in-unison
dataset/ETHPy150Open kastnerkyle/PyCon2015/matrix_factorization.py/shuffle_in_unison