Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Returns the first row as a Row.
Syntax
first()
Returns
Row: First row if DataFrame is not empty, otherwise None.
Examples
df = spark.createDataFrame([
(2, "Alice"), (5, "Bob")], schema=["age", "name"])
df.first()
# Row(age=2, name='Alice')