jeudi 2 juin 2016

Replicate a T-SQL random function in Python

I have a T-SQL code and I want to run a few simulations in Python. There is a code that includes random functions and I am not sure how I can replicate it.

When I have RAND() in SQL, I just use this in Python:

import random as random
print random.random()

But, I have also this code: RAND(CHECKSUM(NEWID()))

I guess, it is used for some kind of seed in the RAND function. But, how I can replicate the same thing in Python to have as much closer results I could?




Aucun commentaire:

Enregistrer un commentaire