Compare Numpy and Matlab code that uses random permutation
This is a common issue. While the random number generator is identical, the function which converts your random number stream into a random permutation is different. There is no specified standard algorithm which describes the expected result.
To solve this issue, you have to use the same library in both tools.
I'm having problems to compare the output of two code because of random number state.
I'm comparing the MATLAB randperm function with the output of the equivalent numpy.random.permutation function but, even if I've set the seed to the same value with a MATLAB rand('twister',0) and a python numpy.random.seed(0) I'm obtaining different permutations.
I've to say that the result of MATLAB's rand and numpy numpy.random.rand are the same if the seed are set like above.