Series.or
Returns the logical OR between Series and other. Supports element wise operations and broadcasting.
danfo.Series.or(other)
Parameters
Type
Description
Default
other
Series, Scalar, Array of Scalars
Data to compare with
Return: Series

Logical OR between two Series object

Node
const dfd = require("danfojs-node")
let data1 = [false, false, false, true, false, false, true];
let data2 = [false, false, false, false, false, false, true];
let sf = new dfd.Series(data1);
let sf2 = new dfd.Series(data2);
let res = sf.or(sf2)
res.print()
Output
╔═══╤═══════╗
║ 0 │ false ║
╟───┼───────╢
║ 1 │ false ║
╟───┼───────╢
║ 2 │ false ║
╟───┼───────╢
║ 3 │ true ║
╟───┼───────╢
║ 4 │ false ║
╟───┼───────╢
║ 5 │ false ║
╟───┼───────╢
║ 6 │ true ║
╚═══╧═══════╝

Logical OR between Series and Array of the same length

Node
const dfd = require("danfojs-node")
let data1 = [false, false, false, true, false, false, true];
let data2 = [false, false, false, false, false, false, true];
let sf = new dfd.Series(data1);
let res = sf.or(data2)
res.print()
Output
╔═══╤═══════╗
║ 0 │ false ║
╟───┼───────╢
║ 1 │ false ║
╟───┼───────╢
║ 2 │ false ║
╟───┼───────╢
║ 3 │ true ║
╟───┼───────╢
║ 4 │ false ║
╟───┼───────╢
║ 5 │ false ║
╟───┼───────╢
║ 6 │ true ║
╚═══╧═══════╝

Logical OR between a Series and single value with broadcasting

Node
const dfd = require("danfojs-node")
let data1 = [false, false, false, true, false, false, true];
let sf = new dfd.Series(data1);
let res = sf.or(false)
res.print()
Output
╔═══╤═══════╗
║ 0 │ false ║
╟───┼───────╢
║ 1 │ false ║
╟───┼───────╢
║ 2 │ false ║
╟───┼───────╢
║ 3 │ true ║
╟───┼───────╢
║ 4 │ false ║
╟───┼───────╢
║ 5 │ false ║
╟───┼───────╢
║ 6 │ true ║
╚═══╧═══════╝
Last modified 8mo ago
Copy link
On this page
Logical OR between two Series object
Logical OR between Series and Array of the same length
Logical OR between a Series and single value with broadcasting