Series.dt.seconds
Obtain the seconds in Date series
danfo.Series.dt.seconds()
Parameters: None
Returns: Series (Int elements)
Example
Obtain the seconds of the datetime
Node
Browser
1
const dfd = require("danfojs-node")
2
3
let data = new dfd.dateRange({"start":"2000-01-01", period:3, freq:"s"})
4
let sf = new dfd.Series(data)
5
//print the series frame
6
sf.print()
7
8
//print the seconds obtained
9
sf.dt.seconds().print()
Copied!
1
Copied!
Output
1
╔═══╤══════════════════════╗
2
║ 0 │ 1/1/2000, 1:00:00 AM ║
3
╟───┼──────────────────────╢
4
║ 1 │ 1/1/2000, 1:00:01 AM ║
5
╟───┼──────────────────────╢
6
║ 2 │ 1/1/2000, 1:00:02 AM ║
7
╚═══╧══════════════════════╝
8
9
╔═══╤═══╗
10
║ 0 │ 0 ║
11
╟───┼───╢
12
║ 1 │ 1 ║
13
╟───┼───╢
14
║ 2 │ 2 ║
15
╚═══╧═══╝
Copied!
Copy link