Dataframe.rows
This function returns a specific number of rows of the dataframe, this function takes an object with either the start or the end index and return the dataframe with the specified number of rows
Parameter
Indexer.start?: number
- if provided, specifies the begin, or else default to the first row in the dataframeIndexer.end?: number
- if provided, specifies the end, or else default to the last row in the dataframe
Returns
Dataframe<T>
const first_four: Dataframe<T> = df.rows({ start: 0, end: 4 }); // first 4 rows
Let's say you want the dataframe to have the first 250 rows, making the value of end
, 250
return the first 250 rows and omits the remaining, and intuitively changing the value of end
, to n
gives you n
number of rows and omits the remaining and so on.
const first_250: Dataframe<T> = df.rows({ end: 250 });
Not providing the start
and end
value will by default returns the entire rows of the dataframe
const count: Dataframe<T> = df.rows({});