import rpy2.robjects as robjects
data = robjects.r("""
set.seed(1)
x <- runif(5)
""")
print(np.array(data))
data[1] = 1.0
print(robjects.r['x'])
Creating same random number sequence in Python, NumPy and R