pyspark.sql.DataFrame.first

DataFrame.first()[source]

Returns the first row as a Row.

>>> df.first()
Row(age=2, name='Alice')

New in version 1.3.