---
title: take
description: "DataFrame.take method in PySpark: Returns the first num rows as a list of Row."
canonical_url: https://docs.databricks.com/gcp/en/pyspark/reference/classes/dataframe/take
---

# take

Returns the first `num` rows as a list of `Row`.

## Syntax

```
take(num: int)
```

## Parameters

| Parameter | Type | Description                                                                                                                                |
| --------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| `num`     | int  | Number of records to return. Will return this number of records or all records if the DataFrame contains less than this number of records. |

## Returns

list: List of rows.

## Examples

```python
df = spark.createDataFrame(
    [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"])

df.take(2)
# [Row(age=14, name='Tom'), Row(age=23, name='Alice')]
```
