---
title: offset
description: "DataFrame.offset method in PySpark: Returns a new DataFrame by skipping the first n rows."
canonical_url: https://docs.databricks.com/gcp/en/pyspark/reference/classes/dataframe/offset
---

# offset

Returns a new DataFrame by skipping the first `n` rows.

*Added in Databricks Runtime 13.1*

## Syntax

```
offset(num: int)
```

## Parameters

| Parameter | Type | Description                |
| --------- | ---- | -------------------------- |
| `num`     | int  | Number of records to skip. |

## Returns

`DataFrame`: Subset of the records.

## Examples

```python
df = spark.createDataFrame(
    [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"])
df.offset(1).show()
# +---+-----+
# |age| name|
# +---+-----+
# | 23|Alice|
# | 16|  Bob|
# +---+-----+
df.offset(10).show()
# +---+----+
# |age|name|
# +---+----+
# +---+----+
```
