【发布时间】:2016-09-12 19:07:18
【问题描述】:
我在 Zeppelin 的 Python 段落中创建了一个 spark DataFrame。
sqlCtx = SQLContext(sc)
spDf = sqlCtx.createDataFrame(df)
而df 是一个熊猫数据框
print(type(df))
<class 'pandas.core.frame.DataFrame'>
我想要做的是将spDf 从一个 Python 段落移动到另一个 Scala 段落。看起来合理的做法是使用z.put。
z.put("spDf", spDf)
我得到了这个错误:
AttributeError: 'DataFrame' object has no attribute '_get_object_id'
有什么建议可以解决这个错误吗?或者有什么移动spDf的建议?
【问题讨论】:
标签: python scala apache-spark apache-spark-sql apache-zeppelin