DataFrame.
__getattr__
Returns the Column denoted by name.
Column
name
New in version 1.3.0.
Changed in version 3.4.0: Supports Spark Connect.
Column name to return as Column.
Requested column.
Examples
>>> df = spark.createDataFrame([ ... (2, "Alice"), (5, "Bob")], schema=["age", "name"])
Retrieve a column instance.
>>> df.select(df.age).show() +---+ |age| +---+ | 2| | 5| +---+