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

Method search

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

Source from the content-addressed store, hash-verified

502 */
503 search(str: string, options?: { inplace?: boolean }): Series
504 search(str = "", options?: { inplace?: boolean }): Series | void {
505 const { inplace } = { inplace: false, ...options }
506 const newArr: Array<string | number> = [];
507 this.values.map((val) => {
508 if (utils.isEmpty(val)) {
509 newArr.push(NaN);
510 } else {
511 newArr.push(`${val}`.search(str));
512 }
513 });
514 if (inplace) {
515 this.series.$setValues(newArr as ArrayType1D)
516 this.series.print()
517 } else {
518 const sf = this.series.copy()
519 sf.$setValues(newArr as ArrayType1D)
520 return sf;
521 }
522 }
523
524 /**
525 * Extracts a part of a string and returns a new string

Callers 2

strings.test.jsFile · 0.80
strings.test.tsFile · 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