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

Method join

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

Source from the content-addressed store, hash-verified

708 */
709 join(valToJoin: string, joinChar: string, options?: { inplace?: boolean }): Series
710 join(valToJoin = "", joinChar = " ", options?: { inplace?: boolean }): Series | void {
711 const { inplace } = { inplace: false, ...options }
712 const newArr: Array<string | number> = [];
713 this.values.map((val) => {
714 if (utils.isEmpty(val)) {
715 newArr.push(NaN);
716 } else {
717 let leftChar = val;
718 let rightChar = valToJoin;
719 let new_char = `${leftChar}${joinChar}${rightChar}`;
720 newArr.push(new_char);
721 }
722 });
723 if (inplace) {
724 this.series.$setValues(newArr as ArrayType1D)
725 this.series.print()
726 } else {
727 const sf = this.series.copy()
728 sf.$setValues(newArr as ArrayType1D)
729 return sf;
730 }
731 }
732
733 /**
734 * Counts the number of characters in string

Callers 14

strings.test.jsFile · 0.80
$readCSVFunction · 0.80
$toCSVFunction · 0.80
$readCSVFunction · 0.80
$streamCSVFunction · 0.80
$toCSVFunction · 0.80
groupMethod · 0.80
getGroupMethod · 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