I need to generate some random numbers using a seed and the results in python and in "random number generator" from data analysis exel have to be the same.
They both use the Mersenne Twister as the core generator. However, I've tried using the same settings for both of them and I still got different results for each. For the "RNG" in excel,I have to answer the, distribution, number of numbers I need and seed. I need and "uniform" distribution, 5 numbers, and "2519" as a seed. How can I make the two results match?
This is the code I'm using to generate the random numbers in python:
import random
random.seed(2519)
for i in range(5):
print(random.uniform(2, 98))
Since I'm using the same configuration, I expected the result I got from excel:
20,29352702
26,21167638
50,5962096
89,57689138
91,71562853
However, my code printed:
87.86907401941477
4.168159315747875
95.86785037507858
92.44359253465223
77.63783740240486
Can someone please tell me what am I doing wrong?
Aucun commentaire:
Enregistrer un commentaire