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
Node
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()
Output
Output
╔═══╤══════════════════════╗
║ │ 0 ║
╟───┼──────────────────────╢
║ 0 │ 1 ║
╟───┼──────────────────────╢
║ 1 │ 2 ║
╟───┼──────────────────────╢
║ 2 │ 3 ║
╟───┼──────────────────────╢
║ 3 │ 4 ║
╟───┼──────────────────────╢
║ 4 │ 5 ║
╚═══╧══════════════════════╝