Skip to content

Latest commit

 

History

History
51 lines (42 loc) · 1.9 KB

series.str.includes.md

File metadata and controls

51 lines (42 loc) · 1.9 KB
description
Checks whether a string contains the specified string/characters

Series.str.includes

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

{% tabs %} {% tab title="Node" %}

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()

{% endtab %}

{% tab title="Browser" %}

{% endtab %} {% endtabs %}

{% tabs %} {% tab title="Output" %}

╔═══╤══════════════════════╗
║   │ 0                    ║
╟───┼──────────────────────╢
║ 0 │ false                ║
╟───┼──────────────────────╢
║ 1 │ true                 ║
╟───┼──────────────────────╢
║ 2 │ false                ║
╟───┼──────────────────────╢
║ 3 │ true                 ║
╚═══╧══════════════════════╝

{% endtab %} {% endtabs %}