weixin_45339899
weixin_45339899
2021-03-20 09:34
采纳率: 0%
浏览 81
已结题

python提示dataframe has no attribute 'shape'的错误

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里就不行了?

  • 点赞
  • 收藏

3条回答 默认 最新

  • herosunly
    herosunly 2021-03-20 09:42

    最好把错误截个图。

    点赞 评论
  • bill20100829
    歇歇 2021-03-20 14:28

    代码不完整

    点赞 评论
  • bill20100829
    歇歇 2021-03-20 14:28

    dataframe.value.shape()

    点赞 评论

相关推荐