def _do_bistochastic_test(scaled):
 _do_scale_test(scaled)
 assert_almost_equal(scaled.sum(axis=0).mean(), scaled.sum(axis=1).mean(), decimal=1)

def _do_bistochastic_test ( scaled ) : _do_scale_test ( scaled ) assert_almost_equal ( scaled . sum ( axis = 0 ) . mean ( ) , scaled . sum ( axis = 1 ) . mean ( ) , decimal = 1 )
check that rows and columns sum to the same constant .