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

Method toUpperCase

src/danfojs-base/core/strings.ts:83–103  ·  view source on GitHub ↗
(options?: { inplace?: boolean })

Source from the content-addressed store, hash-verified

81 */
82 toUpperCase(options?: { inplace?: boolean }): Series
83 toUpperCase(options?: { inplace?: boolean }): Series | void {
84 const { inplace } = { inplace: false, ...options }
85 const newArr: Array<string | number> = [];
86 this.values.map((val) => {
87 if (utils.isEmpty(val)) {
88 newArr.push(NaN);
89 } else {
90 newArr.push(`${val}`.toUpperCase());
91 }
92
93 });
94 if (inplace) {
95 this.series.$setValues(newArr as ArrayType1D)
96 this.series.print()
97 } else {
98 const sf = this.series.copy()
99 sf.$setValues(newArr as ArrayType1D)
100 return sf;
101
102 }
103 }
104
105 /**
106 * Capitalize first string

Callers 4

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