简体   繁体   中英

Spark .show()'s table is not aligned in Google Colab

I am testing Apache Spark command on Google Colabs, but the table that is printed out does not aligned. It looks fine on some machines, but not on some machines.

So I wonder if anyone could help clarify why does this happen. Thank you!

在此处输入图像描述

Spark has an option to show your dataframe on Jupyter Notebook like Pandas.

spark.conf.set("spark.sql.repl.eagerEval.enabled",True)

Your Dataframe will be shown as a HTML Table.

df = spark.read.option("header",True).csv("sample.csv")
df.limit(10)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM