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
Node
const dfd = require("danfojs-node")
let data = new dfd.date_range({"start":"2000-01-01", period:3, freq:"s"})
let sf = new dfd.Series(data)
//print the series frame
sf.print()
//print the seconds obtained
sf.seconds().print()
Browser
Output
Output
╔═══╤══════════════════════╗
║ │ 0 ║
╟───┼──────────────────────╢
║ 0 │ 1/1/2000, 1:00:00 AM ║
╟───┼──────────────────────╢
║ 1 │ 1/1/2000, 1:00:01 AM ║
╟───┼──────────────────────╢
║ 2 │ 1/1/2000, 1:00:02 AM ║
╚═══╧══════════════════════╝
//the seconds obtained
╔═══╤══════════════════════╗
║ │ 0 ║
╟───┼──────────────────────╢
║ 0 │ 0 ║
╟───┼──────────────────────╢
║ 1 │ 1 ║
╟───┼──────────────────────╢
║ 2 │ 2 ║
╚═══╧══════════════════════╝