Powered By GitBook
Series.dt.seconds
Obtain the seconds in Date series
danfo.Series.dt.seconds() [source]
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.date_range({"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
╔═══╤══════════════════════╗
3
║ 0 │ 1/1/2000, 1:00:00 AM ║
4
╟───┼──────────────────────╢
5
║ 1 │ 1/1/2000, 1:00:01 AM ║
6
╟───┼──────────────────────╢
7
║ 2 │ 1/1/2000, 1:00:02 AM ║
8
╚═══╧══════════════════════╝
9
10
╔═══╤═══╗
11
║ 0 │ 0 ║
12
╟───┼───╢
13
║ 1 │ 1 ║
14
╟───┼───╢
15
║ 2 │ 2 ║
16
╚═══╧═══╝
17
Copied!
Last modified 24d ago
Copy link