pyspark.sql.DataFrame.first

DataFrame.first() → Optional[pyspark.sql.types.Row][source]

Returns the first row as a Row.

New in version 1.3.0.

Examples

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