Powered By GitBook
Series.dt.hour
Obtain the hours in a time series
danfo.Series.dt.hour() [source]
Parameters: None
Returns: Series (int elements)
Examples
Node
Browser
1
const dfd = require("danfojs-node")
2
3
let data = new dfd.date_range({"start":"2000-01-01", period:3, freq:"H"})
4
let sf = new dfd.Series(data)
5
// print series
6
sf.print()
7
// print hour series
8
sf.dt.hours().print()
Copied!
1
Copied!
Output
1
╔═══╤══════════════════════╗
2
║ 0 │ 1/1/2000, 1:00:00 AM ║
3
╟───┼──────────────────────╢
4
║ 1 │ 1/1/2000, 2:00:00 AM ║
5
╚═══╧══════════════════════╝
6
7
╔═══╤═══╗
8
║ 0 │ 1 ║
9
╟───┼───╢
10
║ 1 │ 2 ║
11
╚═══╧═══╝
12
Copied!
Last modified 24d ago
Copy link