Powered By GitBook
Series.and
Returns the logical AND between Series and other. Supports element wise operations and broadcasting.
danfo.Series.and(other) [source]
Parameters
Type
Description
Default
other
Series, Scalar, Array of Scalars
Data to compare with
Return: Series

Logical AND between two Series object

Node
1
const dfd = require("danfojs-node")
2
3
let data1 = [false, false, false, true, false, false, true];
4
let data2 = [false, false, false, false, false, false, true];
5
6
let sf = new dfd.Series(data1);
7
let sf2 = new dfd.Series(data2);
8
let res = sf.and(sf2)
9
res.print()
Copied!
Output
1
╔═══╤═══════╗
2
║ 0 │ false ║
3
╟───┼───────╢
4
║ 1 │ false ║
5
╟───┼───────╢
6
║ 2 │ false ║
7
╟───┼───────╢
8
║ 3 │ false ║
9
╟───┼───────╢
10
║ 4 │ false ║
11
╟───┼───────╢
12
║ 5 │ false ║
13
╟───┼───────╢
14
║ 6 │ true ║
15
╚═══╧═══════╝
Copied!

Logical AND between Series and Array of the same length

Node
1
const dfd = require("danfojs-node")
2
3
let data1 = [false, false, false, true, false, false, true];
4
let data2 = [false, false, false, false, false, false, true];
5
6
let sf = new dfd.Series(data1);
7
let res = sf.and(data2)
8
res.print()
Copied!
Output
1
╔═══╤═══════╗
2
║ 0 │ false ║
3
╟───┼───────╢
4
║ 1 │ false ║
5
╟───┼───────╢
6
║ 2 │ false ║
7
╟───┼───────╢
8
║ 3 │ false ║
9
╟───┼───────╢
10
║ 4 │ false ║
11
╟───┼───────╢
12
║ 5 │ false ║
13
╟───┼───────╢
14
║ 6 │ true ║
15
╚═══╧═══════╝
Copied!

Logical AND between a Series and single value with broadcasting

Node
1
const dfd = require("danfojs-node")
2
let data1 = [false, false, false, true, false, false, true];
3
4
let sf = new dfd.Series(data1);
5
let res = sf.and(false)
6
res.print()
Copied!
Output
1
╔═══╤═══════╗
2
║ 0 │ false ║
3
╟───┼───────╢
4
║ 1 │ false ║
5
╟───┼───────╢
6
║ 2 │ false ║
7
╟───┼───────╢
8
║ 3 │ false ║
9
╟───┼───────╢
10
║ 4 │ false ║
11
╟───┼───────╢
12
║ 5 │ false ║
13
╟───┼───────╢
14
║ 6 │ false ║
15
╚═══╧═══════╝
Copied!
Last modified 24d ago