nxcals.api.extraction.data.builders.DataFrame.offset
- DataFrame.offset(num: int) DataFrame
Returns a new :class: DataFrame by skipping the first n rows.
New in version 3.4.0.
Changed in version 3.5.0: Supports vanilla PySpark.
- Parameters:
num (int) – Number of records to skip.
- Returns:
Subset of the records
- Return type:
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| +---+----+ +---+----+