datatable.Frame.head()¶
Return the first n rows of the frame.
If the number of rows in the frame is less than n, then all rows
are returned.
This is a convenience function and it is equivalent to DT[:n, :].
Parameters¶
n
intThe maximum number of rows to return, 10 by default. This number cannot be negative.
return
FrameA frame containing the first up to n rows from the original
frame, and same columns.
Examples¶
DT = dt.Frame(A=["apples", "bananas", "cherries", "dates",
"eggplants", "figs", "grapes", "kiwi"])
DT.head(4)
| A | ||
|---|---|---|
| str32 | ||
| 0 | apples | |
| 1 | bananas | |
| 2 | cherries | |
| 3 | dates |
See also¶
The content on this page is licensed under the Creative Commons Attribution 4.0 License
(CC BY 4.0) ,
and code samples are licensed under the MIT License.