Powered By GitBook
Series.head
Obtain the first n rows for the object based on position.
danfo.Series.head(rows) [source]
Parameters
Type
Description
Default
rows
Int
number of first n values
5
Return: Series
Example
Node
1
const dfd = require("danfojs-node")
2
3
let data1 = [1, 2, 3, 4, 5, 620, 30, 40, 39, 89, 78]
4
let sf1 = new dfd.Series(data1)
5
6
sf1.head().print()
Copied!
Output
1
╔═══╤══════════════════════╗
2
║ │ 0 ║
3
╟───┼──────────────────────╢
4
║ 0 │ 1 ║
5
╟───┼──────────────────────╢
6
║ 1 │ 2 ║
7
╟───┼──────────────────────╢
8
║ 2 │ 3 ║
9
╟───┼──────────────────────╢
10
║ 3 │ 4 ║
11
╟───┼──────────────────────╢
12
║ 4 │ 5 ║
13
╚═══╧══════════════════════╝
Copied!
Last modified 1yr ago
Copy link