Powered By GitBook
Series.str.includes
Checks whether a string contains the specified string/characters
danfo.Series.str.includes(str, options) [source]
Parameters
Type
Description
Default
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
Node
Browser
1
const dfd = require("danfojs-node")
2
3
let data = ['lower', 'CAPITALS', 'this is a sentence', 'SwApCaSe']
4
let sf = new dfd.Series(data)
5
sf.str.includes("C").print()
Copied!
1
Copied!
Output
1
╔═══╤══════════════════════╗
2
║ │ 0 ║
3
╟───┼──────────────────────╢
4
║ 0 │ false ║
5
╟───┼──────────────────────╢
6
║ 1 │ true ║
7
╟───┼──────────────────────╢
8
║ 2 │ false ║
9
╟───┼──────────────────────╢
10
║ 3 │ true ║
11
╚═══╧══════════════════════╝
Copied!
Last modified 13d ago
Copy link