I’m using rpy2 and I have this issue that’s bugging me: I know how to convert a Python array or list to a FloatVector that R (thanks to rpy2) can handle within Python.
Can the opposite can be done? For example, I have a FloatVector or Matrix that is an R object. How can I convert it back to a Python array or list?
Found the answer myself :-). Suppose vector_R is a FloatVector. To convert it back to Python you need to do:
And that’s it! “vector” is now a Numpy array.