1

I am given some python codes which depends on random numbers. This python code use a random_seed = 300.

Now I am trying to replicate this Python code in R. To make sure that the replication is perfect, I need to compare the end results between R and Python. Given that, the code depends on the random numbers, is there any way to know the equivalent random seed to be used in R?

I had a look into Creating same random number sequence in Python, NumPy and R, but it appears to be opposite way implementation i.e. from R to Python.

There is also a R library called reticulate where I could run python code in R, but could not figure out if I could fetch the R-equivalent random seed using this library

Any pointer will be very helpful.

Many thanks,

Brian Smith
  • 1,200
  • 4
  • 16

0 Answers0