Current conversion of R objects into Python usng pandas2ri.ri2py does not work for the <class 'rpy2.robjects.vectors.ListVector'> object. As noted here, pandas2ri.py2ri() and pandas2ri.ri2py() are current methods to handle conversion. However, previous deprecated com.convert_robj() correctly converts the R object to Python dictionary:

import rpy2
from rpy2.robjects.numpy2ri import numpy2ri
from rpy2.robjects.packages import importr
import numpy as np

# FISHER EXACT TEST EXAMPLE
cont = np.reshape(np.arange(0,4), (2,2))  
statspackage = importr('stats',  robject_translations={'format_perc': '_format_perc'})
result = statspackage.fisher_test(numpy2ri(cont), simulate_p_value = True, B = 100)

# DEPRECATED CONVERSION
import pandas.rpy.common as com
pyresultdict = com.convert_robj(result)

print(type(pyresultdict))   # PYTHON DICTIONARY TYPE

# CURRENT CONVERSION
from rpy2.robjects import pandas2ri
pandas2ri.activate()
pyresultdict = pandas2ri.ri2py(result)

print(type(pyresultdict))   # REMAINS R LISTVECTOR TYPE
# Expected Output
<class 'dict'>
<class 'dict'>
# output of rpy2.__version__
2.5.4

# output of  pd.show_versions()
INSTALLED VERSIONS
------------------
commit: None
python: 3.4.1.final.0
python-bits: 64
OS: Windows
OS-release: 8
machine: AMD64
processor: Intel64 Family 6 Model 37 Stepping 2, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None

pandas: 0.18.0
nose: None
pip: 8.1.0
setuptools: 2.1
Cython: None
numpy: 1.10.4
scipy: 0.17.0
...

Comment From: jreback

rpy2 is supported directly http://rpy.sourceforge.net/rpy2/doc-2.5/html/overview.html

not in pandas any longer

Comment From: ParfaitG

Interestingly the pandas 0.18 rpy2 page pointed me here to report Issues. See link in second Warning box. Please have the Pandas team update page accordingly.

Comment From: jreback

you can do a PR if you want

Comment From: ParfaitG

Forgive me - please advise what "PR" means and how to do it on GitHub.

Comment From: jreback

http://pandas.pydata.org/pandas-docs/stable/contributing.html

you might be able to submit this directly using github as this is just a doc-change. as opposed to fokring & cloning the repo and submitting

Comment From: lgautier

FWIW rpy2's doc has moved to readthedoc some time ago: http://rpy2.readthedocs.io/

Comment From: ParfaitG

Thanks @lgautier. The pandas team may want to add the link to their rpy2 page.

Comment From: jreback

thanks @lgautier updated for 0.18.1 release (soon)

Comment From: jorisvandenbossche

@ParfaitG Late reply, but I think your question above on how to convert such a ListVector as in your example is a very valid question. As we are going to remove pandas.rpy from pandas, can you report this either on the rpy2 issue tracker or raise concerns in the main issue: https://github.com/pandas-dev/pandas/issues/9602

Comment From: lgautier

R's list objects are not constrained to unique names: several items in the list can have the same name.

I'd prefer to leave the conversion explicit (the user writes it in the his or her code and decides what to do if duplicates). I can provide a function that does it but throws an exception if duplicated.