import rpy2.robjects as robjects
df1.to_csv('df1.csv', encoding='utf-8',index=False) r_statement = """ library('lavaan') dat <- read.csv('df1.csv') """ robjects.r(r_statement)
运行上面的代码时,会提示:dataframe has no attribute 'shape'的错误,请问各位大神,怎么解决?在r语言里运行read.csv('df1.csv')就不会提示错误,为什么放到python里就不行了?
最好把错误截个图。
代码不完整
dataframe.value.shape()