Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
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
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|
# +---+----+
# +---+----+