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
int
The maximum number of rows to return, 10 by default. This number cannot be negative.
return
Frame
A 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 | |
---|---|
▪▪▪▪ | |
0 | apples |
1 | bananas |
2 | cherries |
3 | dates |