HyukjinKwon commented on code in PR #37444:
URL: https://github.com/apache/spark/pull/37444#discussion_r955518301
##########
python/pyspark/sql/dataframe.py:
##########
@@ -731,29 +744,51 @@ def show(self, n: int = 20, truncate: Union[bool, int] =
True, vertical: bool =
Examples
--------
- >>> df
- DataFrame[age: int, name: string]
+ >>> df = spark.createDataFrame([(14, "Tom"), (23, "Alice"),
+ ... (16, "Bob")], ["age", "name"])
>>> df.show()
+---+-----+
|age| name|
+---+-----+
- | 2|Alice|
- | 5| Bob|
+ | 14| Tom|
+ | 23|Alice|
+ | 16| Bob|
+ +---+-----+
+
+ Show only top 2 rows.
+
+ >>> df.show(2)
+ +---+-----+
+ |age| name|
+ +---+-----+
+ | 14| Tom|
+ | 23|Alice|
+---+-----+
+ only showing top 2 rows
+
+ Show DataFrame where the maximum number of characters is 3.
Review Comment:
`` :class:`DataFrame` ``
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]