Series.or

Returns the logical OR between Series and other. Supports element wise operations and broadcasting.

danfo.Series.or(other)

ParametersTypeDescriptionDefault

other

Series, Scalar, Array of Scalars

Data to compare with

Return: Series

Logical OR between two Series object

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()
╔═══╤═══════╗
║ 0 │ false ║
╟───┼───────╢
║ 1 │ false ║
╟───┼───────╢
║ 2 │ false ║
╟───┼───────╢
║ 3 │ true  ║
╟───┼───────╢
║ 4 │ false ║
╟───┼───────╢
║ 5 │ false ║
╟───┼───────╢
║ 6 │ true  ║
╚═══╧═══════╝

Logical OR between Series and Array of the same length

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()
╔═══╤═══════╗
║ 0 │ false ║
╟───┼───────╢
║ 1 │ false ║
╟───┼───────╢
║ 2 │ false ║
╟───┼───────╢
║ 3 │ true  ║
╟───┼───────╢
║ 4 │ false ║
╟───┼───────╢
║ 5 │ false ║
╟───┼───────╢
║ 6 │ true  ║
╚═══╧═══════╝

Logical OR between a Series and single value with broadcasting

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()
╔═══╤═══════╗
║ 0 │ false ║
╟───┼───────╢
║ 1 │ false ║
╟───┼───────╢
║ 2 │ false ║
╟───┼───────╢
║ 3 │ true  ║
╟───┼───────╢
║ 4 │ false ║
╟───┼───────╢
║ 5 │ false ║
╟───┼───────╢
║ 6 │ true  ║
╚═══╧═══════╝

Last updated