'Change Robject into Python
Assuming I have a variable named test which has the following datatype and value:
<rpy2.robjects.vectors.FloatVector object at 0x000001F1B51116C0> [RTYPES.REALSXP]
R classes: ('numeric',)
[0.916667]
How do I change it into python variable such that test has a value of 0.916667 ?
I tried to do robjects.conversion.py2rpy(test), but it is not working, so I assume I did it wrongly... I tried searching the web and documentation but still cannot find the answer.
Thank you very much for helping me !
Solution 1:[1]
I found a way to solve this problem. I can easily obtain the answer through
test = test[0]
However, I'm unsure if the same thing would work if I'm converting from R vector to Python vector.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | RofyRafy |
