Powered By GitBook
Series.eq
Check all the values in a series is equal to another value
danfo.Series.eq(other) [source]
Parameters
Type
Description
Default
other
Series, Array or number
value to compare
Returns: Series (Boolean element)
Examples
Compare all the values in a series to another series
Node
1
const dfd = require("danfojs-node")
2
3
let data1 = [10, 45, 56, 25, 23, 20, 10]
4
let data2 = [10, 450, 56, 5, 25, 2, 0]
5
let sf1 = new dfd.Series(data1)
6
let sf2 = new dfd.Series(data2)
7
8
sf1.eq(sf2).print()
Copied!
Output
1
╔═══╤══════════════════════╗
2
║ │ 0 ║
3
╟───┼──────────────────────╢
4
║ 0 │ true ║
5
╟───┼──────────────────────╢
6
║ 1 │ false ║
7
╟───┼──────────────────────╢
8
║ 2 │ true ║
9
╟───┼──────────────────────╢
10
║ 3 │ false ║
11
╟───┼──────────────────────╢
12
║ 4 │ false ║
13
╟───┼──────────────────────╢
14
║ 5 │ false ║
15
╟───┼──────────────────────╢
16
║ 6 │ false ║
17
╚═══╧══════════════════════╝
Copied!
Check it all the values are equal to a value
Node
1
const dfd = require("danfojs-node")
2
3
let data1 = [10, 45, 56, 25, 23, 20, 10]
4
let sf1 = new dfd.Series(data1)
5
6
sf1.eq(10).print()
Copied!
Output
1
╔═══╤══════════════════════╗
2
║ │ 0 ║
3
╟───┼──────────────────────╢
4
║ 0 │ true ║
5
╟───┼──────────────────────╢
6
║ 1 │ false ║
7
╟───┼──────────────────────╢
8
║ 2 │ false ║
9
╟───┼──────────────────────╢
10
║ 3 │ false ║
11
╟───┼──────────────────────╢
12
║ 4 │ false ║
13
╟───┼──────────────────────╢
14
║ 5 │ false ║
15
╟───┼──────────────────────╢
16
║ 6 │ true ║
17
╚═══╧══════════════════════╝
Copied!
Last modified 24d ago
Copy link