Series.dt.dayOfWeek
Obtain the days of the weeks
danfo.Series.dt.dayOfWeek() [source]
Parameters: None
Returns: Series (String elements)
Examples
Node
Browser
1
const dfd = require("danfojs-node")
2
3
let data = new dfd.dateRange({"start":'2016-12-31', "end":'2018-01-08'})
4
let sf = new dfd.Series(data)
5
//print series
6
sf.print()
7
//print days of the week
8
sf.dt.dayOfWeek().print()
Copied!
1
Copied!
1
╔═══╤════════════════════════╗
2
║ 0 │ 12/31/2016, 1:00:00 AM ║
3
╟───┼────────────────────────╢
4
║ 1 │ 1/1/2017, 1:00:00 AM ║
5
╟───┼────────────────────────╢
6
║ 2 │ 1/2/2017, 1:00:00 AM ║
7
╟───┼────────────────────────╢
8
║ 3 │ 1/3/2017, 1:00:00 AM ║
9
╟───┼────────────────────────╢
10
║ 4 │ 1/4/2017, 1:00:00 AM ║
11
╟───┼────────────────────────╢
12
║ 5 │ 1/5/2017, 1:00:00 AM ║
13
╟───┼────────────────────────╢
14
║ 6 │ 1/6/2017, 1:00:00 AM ║
15
╟───┼────────────────────────╢
16
║ 7 │ 1/7/2017, 1:00:00 AM ║
17
╟───┼────────────────────────╢
18
║ 8 │ 1/8/2017, 1:00:00 AM ║
19
╟───┼────────────────────────╢
20
║ 9 │ 1/9/2017, 1:00:00 AM ║
21
╚═══╧════════════════════════╝
22
23
╔═══╤═══╗
24
║ 0 │ 6 ║
25
╟───┼───╢
26
║ 1 │ 0 ║
27
╟───┼───╢
28
║ 2 │ 1 ║
29
╟───┼───╢
30
║ 3 │ 2 ║
31
╟───┼───╢
32
║ 4 │ 3 ║
33
╟───┼───╢
34
║ 5 │ 4 ║
35
╟───┼───╢
36
║ 6 │ 5 ║
37
╟───┼───╢
38
║ 7 │ 6 ║
39
╟───┼───╢
40
║ 8 │ 0 ║
41
╟───┼───╢
42
║ 9 │ 1 ║
43
╚═══╧═══╝
Copied!
Last modified 13d ago
Copy link