MCPcopy Index your code
hub / github.com/javascriptdata/danfojs / includes

Method includes

src/danfojs-base/core/strings.ts:327–345  ·  view source on GitHub ↗
(str = "", options?: { inplace?: boolean })

Source from the content-addressed store, hash-verified

325 */
326 includes(str: string, options?: { inplace?: boolean }): Series
327 includes(str = "", options?: { inplace?: boolean }): Series | void {
328 const { inplace } = { inplace: false, ...options }
329 const newArr: Array<boolean | number> = [];
330 this.values.map((val) => {
331 if (utils.isEmpty(val)) {
332 newArr.push(NaN);
333 } else {
334 newArr.push(`${val}`.includes(str));
335 }
336 });
337 if (inplace) {
338 this.series.$setValues(newArr as ArrayType1D)
339 this.series.print()
340 } else {
341 const sf = this.series.copy()
342 sf.$setValues(newArr as ArrayType1D)
343 return sf;
344 }
345 }
346
347 /**
348 * Returns the position of the first occurrence of a specified value in a string.

Callers 15

strings.test.jsFile · 0.80
frame.test.jsFile · 0.80
piePlotFunction · 0.80
checkIfColsExistFunction · 0.80
throwErrorOnWrongColNameFunction · 0.80
tablePlotFunction · 0.80
cumOpsMethod · 0.80
dropNaMethod · 0.80
addColumnMethod · 0.80
fillNaMethod · 0.80
dropMethod · 0.80
selectDtypesMethod · 0.80

Calls 5

isEmptyMethod · 0.80
$setValuesMethod · 0.80
mapMethod · 0.65
printMethod · 0.65
copyMethod · 0.65

Tested by

no test coverage detected