pyspark.sql.DataFrame.first

DataFrame.first()[source]

Returns the first row as a Row.

New in version 1.3.0.

Examples

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