Choose random seed and save it

前端 未结 5 1366
刺人心
刺人心 2021-02-13 19:03

I would like to choose a random seed for numpy.random and save it to a variable. I can set the seed using numpy.random.seed(seed=None) but how do you

5条回答
  •  难免孤独
    2021-02-13 19:39

    When people need a random seed that can be recorded, people usually use the system time as a random seed. This means your program will act differently each time it is run, but can be saved and captured. Why don't you try that out?

    If you don't want to do that for some reason, use the null version, numpy.random.seed(seed=None), then get a random number from it, then set the seed to that new random number.

提交回复
热议问题