我在rpy2
中有一个daframe输出以下类:
In [58]: [tuple(x.rclass) for x in df_rpy2]
Out[58]: [('integer',), ('integer',), ('numeric',), ('numeric',)]
现在,如果我这样做:
from rpy2.robjects import pandas2ri as pd2ri
tmp = pd2ri.ri2py(df_rpy2)
df_from_pd = pd2ri.py2ri(tmp)
print([tuple(x.rclass) for x in df_from_pd])
我得到[('array',), ('array',), ('array',), ('array',)]
如何才能拥有初始课程?