Series.head

Obtain the first n rows for the object based on position.

danfo.Series.head(rows)

ParametersTypeDescriptionDefault

rows

Int

number of first n values

5

Return: Series

Example

const dfd = require("danfojs-node")

let data1 = [1, 2, 3, 4, 5, 620, 30, 40, 39, 89, 78]
let sf1 = new dfd.Series(data1)

sf1.head().print()
╔═══╤══════════════════════╗
║   │ 0                    ║
╟───┼──────────────────────╢
║ 0 │ 1                    ║
╟───┼──────────────────────╢
║ 1 │ 2                    ║
╟───┼──────────────────────╢
║ 2 │ 3                    ║
╟───┼──────────────────────╢
║ 3 │ 4                    ║
╟───┼──────────────────────╢
║ 4 │ 5                    ║
╚═══╧══════════════════════╝

Last updated