Parameters: seed : {None, int, array_like}, optional
Random seed initializing the pseudo-random number generator. Can be an
integer, an array (or other sequence) of integers of any length, or
None (the default). If seed is None, then RandomState will try to read
data from /dev/urandom (or the Windows analogue) if available or seed
from the clock otherwise.
您不需要在随机排列之前初始化种子,因为这已经为您设置好了。 根据RandomState的文档:
种子的概念与随机数的产生有关。你可以阅读更多关于它的资料。
为了将这个答案与您的问题的评论(来自JohnColeman)结合起来,我想提到这个例子:
相关问题 更多 >
编程相关推荐