HyukjinKwon commented on code in PR #37521:
URL: https://github.com/apache/spark/pull/37521#discussion_r946370890
##########
python/pyspark/sql/column.py:
##########
@@ -187,18 +187,26 @@ class Column:
"""
A column in a DataFrame.
- :class:`Column` instances can be created by::
+ .. versionadded:: 1.3.0
- # 1. Select a column out of a DataFrame
+ Examples
+ --------
+ :class:`Column` instances can be created by::
- df.colName
- df["colName"]
+ >>> df = spark.createDataFrame(
+ ... [(2, "Alice"), (5, "Bob")], ["age", "name"])
- # 2. Create from an expression
- df.colName + 1
- 1 / df.colName
+ 1. Select a column out of a DataFrame
Review Comment:
```suggestion
Select a column out of a DataFrame
```
##########
python/pyspark/sql/column.py:
##########
@@ -187,18 +187,26 @@ class Column:
"""
A column in a DataFrame.
- :class:`Column` instances can be created by::
+ .. versionadded:: 1.3.0
- # 1. Select a column out of a DataFrame
+ Examples
+ --------
+ :class:`Column` instances can be created by::
- df.colName
- df["colName"]
+ >>> df = spark.createDataFrame(
+ ... [(2, "Alice"), (5, "Bob")], ["age", "name"])
- # 2. Create from an expression
- df.colName + 1
- 1 / df.colName
+ 1. Select a column out of a DataFrame
+ >>> df.name
+ Column<'name'>
+ >>> df["name"]
+ Column<'name'>
- .. versionadded:: 1.3.0
+ 2. Create from an expression
Review Comment:
```suggestion
Create from an expression
```
--
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]