【问题标题】:How to use _repr_html_ with pyspark 2.2 and python 2.7如何在 pyspark 2.2 和 python 2.7 中使用 _repr_html_
【发布时间】:2020-02-05 22:49:50
【问题描述】:

我在终端运行以下行,但出现错误,但在 jupyter notebook 中运行良好。

df._repr_html_()

Traceback(最近一次调用最后一次): 文件“”,第 1 行,在 getattr 中的文件“/usr/lib/spark/python/pyspark/sql/dataframe.py”,第 1020 行 "'%s' 对象没有属性 '%s'" % (self.class.name, name)) AttributeError: 'DataFrame' 对象没有属性 '_repr_html_'

【问题讨论】:

    标签: pyspark-sql


    【解决方案1】:

    它在我的终端上不起作用,因为它不是一个可视解释器,所以我必须通过数据框收集我需要的值并创建一个像 html 这样的字符串。然后,我可以附加到我在终端上从 python 发送的电子邮件并且工作正常。

    【讨论】:

      猜你喜欢
      • 2020-02-03
      • 2019-05-27
      • 1970-01-01
      • 2018-11-06
      • 1970-01-01
      • 2016-11-03
      • 2016-05-20
      • 2017-11-04
      • 1970-01-01
      相关资源
      最近更新 更多