datatable.repeat()¶
Concatenate n
copies of the frame
by rows and return the result.
This is equivalent to dt.rbind([frame] * n)
.
Example¶
from datatable import dt
DT = dt.Frame({"A": [1, 1, 2, 1, 2],
"B": [None, 2, 3, 4, 5]})
DT
A | B | ||
---|---|---|---|
int32 | int32 | ||
0 | 1 | NA | |
1 | 1 | 2 | |
2 | 2 | 3 | |
3 | 1 | 4 | |
4 | 2 | 5 |
dt.repeat(DT, 2)
A | B | ||
---|---|---|---|
int32 | int32 | ||
0 | 1 | NA | |
1 | 1 | 2 | |
2 | 2 | 3 | |
3 | 1 | 4 | |
4 | 2 | 5 | |
5 | 1 | NA | |
6 | 1 | 2 | |
7 | 2 | 3 | |
8 | 1 | 4 | |
9 | 2 | 5 |
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.