How can I pretty print a data frame in Zeppelin/Spark/Scala?

后端 未结 1 1424
春和景丽
春和景丽 2021-01-07 21:00

I am using Spark 2 and Scala 2.11 in a Zeppelin 0.7 notebook. I have a dataframe that I can print like this:

dfLemma.select(\"text\", \"lemma\").show(20,fals         


        
相关标签:
1条回答
  • 2021-01-07 21:25

    In Zeppelin you can use z.show(df) to show a pretty table. Here's an example:

    val df = Seq(
      (1,1,1), (2,2,2), (3,3,3)
    ).toDF("first_column", "second_column", "third_column")
    
    z.show(df)
    

    0 讨论(0)
提交回复
热议问题