snowflake.snowpark.DataFrame.limit¶
- DataFrame.limit(n: int, offset: int = 0) DataFrame[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.23.0/src/snowflake/snowpark/dataframe.py#L1847-L1878)¶
- Returns a new DataFrame that contains at most - nrows from the current DataFrame, skipping- offsetrows from the beginning (similar to LIMIT and OFFSET in SQL).- Note that this is a transformation method and not an action method. - Parameters:
- n – Number of rows to return. 
- offset – Number of rows to skip before the start of the result set. The default value is 0. 
 
 - Example: - >>> df = session.create_dataframe([[1, 2], [3, 4]], schema=["a", "b"]) >>> df.limit(1).show() ------------- |"A" |"B" | ------------- |1 |2 | ------------- >>> df.limit(1, offset=1).show() ------------- |"A" |"B" | ------------- |3 |4 | -------------