anonR
anonR

Reputation: 929

R integer to python integer conversion issue package reticulate

I need to pass a very big integer argument to python using reticulate call, But I can't seem to find a way to do this. Any suggestions on how to do this? See the python object is in int class but the R numeric is passed as float which is expected, But I have tried to use gmp and bit64 package in R to have this big integer in R but it is not passed as class int in python anyhow.

> library(reticulate)
> use_python("/usr/bin/python3")
> py_run_string("obj = 10**18;")
> py_eval('type(obj)')
<class 'int'>
> class(r_to_py(10^18))
[1] "python.builtin.float"  "python.builtin.object"

Upvotes: 0

Views: 364

Answers (0)

Related Questions