5 ms·
If you are using Python, you should use the standard 'random.shuffle' which does use the Fisher-Yates algorithm.
by nobodysfool2 12y ago
If you are using Python, you should use the standard 'random.shuffle' which does use the Fisher-Yates algorithm.
- silentbicycle 12y agoThere's value in knowing how it's implemented.
- taeric 12y agoFurther, there is value in knowing what makes the incorrect ways incorrect. :) Also, even in the article it noted to use a library if your language allows.
- cruise02 12y agoIt does seem strange to say "However, there are plenty of languages that don’t provide built in support for such a function, leaving you on your own." and then show examples in Python.
- kiyoto 12y agoIf you are using Excel, you might find my blog entry useful: http://kiyototamura.tumblr.com/post/91613880102/generating-a-random-permutation-in-excel http://kiyototamura.tumblr.com/post/91613880102/generating-a...