Skip to content

Latest commit

 

History

History
51 lines (41 loc) · 1.01 KB

series.dt.hour.md

File metadata and controls

51 lines (41 loc) · 1.01 KB
description
Obtain the hours in a time series

Series.dt.hours

danfo.Series.dt.hours()

Parameters: None

Returns: Series (int elements)

Examples

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

const dfd = require("danfojs-node")

let data = new dfd.dateRange({"start":"2000-01-01", period:3, freq:"H"})
let sf = new dfd.Series(data)
// print series
sf.print()
// print hour series
sf.dt.hours().print()

{% endtab %}

{% tab title="Browser" %}

{% endtab %} {% endtabs %}

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

╔═══╤══════════════════════╗
║ 0 │ 1/1/2000, 1:00:00 AM ║
╟───┼──────────────────────╢
║ 1 │ 1/1/2000, 2:00:00 AM ║
╚═══╧══════════════════════╝

╔═══╤═══╗
║ 0 │ 1 ║
╟───┼───╢
║ 1 │ 2 ║
╚═══╧═══╝

{% endtab %} {% endtabs %}