Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/apache-spark/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
显示、显示和发送到';我不能在iPython笔记本上工作_Python_Apache Spark_Ipython_Show - Fatal编程技术网

显示、显示和发送到';我不能在iPython笔记本上工作

显示、显示和发送到';我不能在iPython笔记本上工作,python,apache-spark,ipython,show,Python,Apache Spark,Ipython,Show,我正试图在ipython笔记本中显示或显示()html我的数据帧,但它抛出了错误“AttributeError”。只有显示器(df1)正在打印df模式,如下所示: DataFrame[name: string, age: bigint] 这是我的密码: from IPython.display import display, HTML data = [('Alice',1),('Bob',2)] df1 = sqlContext.createDataFrame(data, ['name','

我正试图在ipython笔记本中显示或显示()html我的数据帧,但它抛出了错误“AttributeError”。只有显示器(df1)正在打印df模式,如下所示:

DataFrame[name: string, age: bigint]
这是我的密码:

from IPython.display import display, HTML

data = [('Alice',1),('Bob',2)]
df1 = sqlContext.createDataFrame(data, ['name','age'])
sqlContext.registerDataFrameAsTable(df1, "df1_table")
df2 = sqlContext.sql("Select * from df1_table")

#display(df1)
HTML(df1.to_html)
df1.to_html()

有什么想法吗?

完全的错误是:“AttributeError:DataFrame对象没有\u html的属性”请原谅我的一点知识,我问这个问题是为了理解为什么它没有属性?好吧,我在stackoverflow的另一个线程中找到了这个问题作为答案,这就是为什么。因为它根本没有。考虑到Spark数据帧的确切含义,这可能是毫无用处的。看起来你把Spark数据框和Pandas数据框弄错了,这是两个完全不同的东西。@zero323,谢谢。然后我的问题是如何在这个笔记本中查看spark dataframe的内容?完全的错误是:“AttributeError:dataframe对象没有属于_html的属性”请原谅我的一点知识,我问这个问题是为了理解为什么没有?嗯,我在stackoverflow的另一个线程中找到了这个给_html()的答案,这就是为什么。因为它从来没有。考虑到Spark数据帧的确切含义,这可能是毫无用处的。看起来你把Spark数据框和Pandas数据框弄错了,这是两个完全不同的东西。@zero323,谢谢。那么我的问题是如何在这个笔记本中查看spark dataframe的内容?