可以尝试使用show(n, truncate=False)来显示完整的数据,或者使用其他方法来处理特殊字符,例如使用正则表达式进行替换。 数据为空:如果DataFrame中没有数据,调用show()方法会抛出错误。在调用show()方法之前,可以先使用count()方法检查DataFrame中是否有数据。 总结起来,当pyspark dataframe使用show()
frompyspark.mlimportPipeline frompyspark.ml.classificationimportDecisionTreeClassifier frompyspark.ml.featureimportStringIndexer, VectorIndexer frompyspark.ml.evaluationimportMulticlassClassificationEvaluator # Load the data stored in LIBSVM format as a DataFrame. data = spark.read.format("libsvm").load("dat...
+ print(self._jdf.showString(n, int_truncate, vertical)) def __repr__(self): if not self._support_repr_html and self.sql_ctx._conf.isReplEagerEvalEnabled(): diff --git a/python/pyspark/sql/tests/test_dataframe.py b/python/pyspark/sql/tests/test_dataframe.py index 3e961cb..74895c0...