0

System: Simulating Discrete events for 100 steps with number of events 10; I am using Spyder(Python 3.6); New to python!

Question: Can I generate different random numbers for each step in my loop? I need my random number between (0,1) and for each step, random number should be dynamically generated. I "don't" want random numbers to be repeated.

I am using the command; import numpy as np r = np.random.rand()

Any help regarding this problem is much appreciated.

  • 1
    Possible duplicate of [random.seed(): What does it do?](https://stackoverflow.com/questions/22639587/random-seed-what-does-it-do) – Aymon Fournier Jul 25 '18 at 22:25

1 Answers1

0

You need to seed a pseudo-random number generator. Here is a link to another Stack Overflow question that contains your answer:

random.seed(): What does it do?

Aymon Fournier
  • 4,323
  • 12
  • 42
  • 59
  • No, my question is to generate different random number for each run in my program. However, the number generated for previous run is being stored and regenerated for the next run. –  Jul 25 '18 at 23:02