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

Method split

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

Source from the content-addressed store, hash-verified

572 */
573 split(splitVal: string, options?: { inplace?: boolean }): Series
574 split(splitVal = " ", options?: { inplace?: boolean }): Series | void {
575 const { inplace } = { inplace: false, ...options }
576 const newArr: Array<string | number> = [];
577 this.values.map((val) => {
578 if (utils.isEmpty(val)) {
579 newArr.push(NaN);
580 } else {
581 newArr.push(`${String(val).split(splitVal)}`);
582 }
583 });
584 if (inplace) {
585 this.series.$setValues(newArr as ArrayType1D)
586 this.series.print()
587 } else {
588 const sf = this.series.copy()
589 sf.$setValues(newArr as ArrayType1D)
590 return sf;
591 }
592 }
593
594 /**
595 * Extracts the characters from a string, beginning at a specified start position, and through the specified number of character

Callers 6

strings.test.jsFile · 0.80
_ilocFunction · 0.80
_locFunction · 0.80
colKeyDictMethod · 0.80
strings.test.tsFile · 0.80
transformerFunction · 0.80

Calls 5

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

Tested by 1

transformerFunction · 0.64