---
title: first (DataFrame)
description: "DataFrame.first method in PySpark: Returns the first row as a Row."
canonical_url: https://docs.databricks.com/gcp/en/pyspark/reference/classes/dataframe/first
---

# first (DataFrame)

Returns the first row as a `Row`.

## Syntax

```
first()
```

## Returns

`Row`: First row if DataFrame is not empty, otherwise `None`.

## Examples

```python
df = spark.createDataFrame([
    (2, "Alice"), (5, "Bob")], schema=["age", "name"])
df.first()
# Row(age=2, name='Alice')
```
