Some R datasets can be loaded into a Pandas DataFrame or Panel quite easily:
import pandas.rpy.common as com
infert = com.load_data('infert')
print(infert.head())
This appears to work as long as the dimension of the R dataset is <= 3. Higher dimensional datasets print an error message:
In [67]: com.load_data('Titanic')
Cannot handle dim=4
This error message originates in the rpy/common.py _convert_array
function.
Sure, it makes sense that Pandas can not directly shoe-horn a 4-dimensional matrix into a DataFrame or Panel, but is there some workaround to load datasets like Titanic
into a DataFrame (maybe with a hierarchical index)?