Skip to content

Latest commit

 

History

History
48 lines (39 loc) · 1.76 KB

danfo.dataframe.tail.md

File metadata and controls

48 lines (39 loc) · 1.76 KB
description
Returns the last n rows from the DataFrame based on position.

DataFrame.tail

danfo.DataFrame.tail(rows)

Parameters Type Description Default
rows Int The number of rows to return 5

Examples

{% tabs %} {% tab title="Node" %}

const dfd = require("danfojs-node")

let data = { "Name": ["Apples", "Mango", "Banana", "Pear"],
            "Count": [21, 5, 30, 10],
            "Price": [200, 300, 40, 250] }

let df = new dfd.DataFrame(data)
let s_df = df.tail(3)
s_df.print()

{% endtab %}

{% tab title="Browser" %}

{% endtab %} {% endtabs %}

{% tabs %} {% tab title="Output" %}

╔═══╤═══════════════════╤═══════════════════╤═══════════════════╗
║   │ Name              │ Count             │ Price             ║
╟───┼───────────────────┼───────────────────┼───────────────────╢
║ 2 │ Banana            │ 30                │ 40                ║
╟───┼───────────────────┼───────────────────┼───────────────────╢
║ 3 │ Pear              │ 10                │ 250               ║
╚═══╧═══════════════════╧═══════════════════╧═══════════════════╝

{% endtab %} {% endtabs %}