What does replacement mean in numpy.random.choice?

wking picture wking · Nov 19, 2016 · Viewed 18.5k times · Source

Here explains the function numpy.random.choice. However, I am confused about the third parameter replace. What is it? And in which case will it be useful? Thanks!

Answer

Ignacio Vazquez-Abrams picture Ignacio Vazquez-Abrams · Nov 19, 2016

It controls whether the sample is returned to the sample pool. If you want only unique samples then this should be false.