Series.str.includes

Checks whether a string contains the specified string/characters

danfo.Series.str.includes(str, options) [source]

ParametersTypeDescriptionDefault

str

string

the character(s) to check

""

options

Object

inplace: Whether to perform the operation in-place or not.

{

inplace: false

}

Returns: Series (boolean element)

Example

const dfd = require("danfojs-node")

let data = ['lower', 'CAPITALS', 'this is a sentence', 'SwApCaSe']
let sf = new dfd.Series(data)
sf.str.includes("C").print()
╔═══╤══════════════════════╗
║   │ 0                    ║
╟───┼──────────────────────╢
║ 0 │ false                ║
╟───┼──────────────────────╢
║ 1 │ true                 ║
╟───┼──────────────────────╢
║ 2 │ false                ║
╟───┼──────────────────────╢
║ 3 │ true                 ║
╚═══╧══════════════════════╝

Last updated