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

Method setIndex

src/danfojs-base/core/series.ts:958–972  ·  view source on GitHub ↗
(index: Array<number | string | (number | string)>, options?: { inplace?: boolean })

Source from the content-addressed store, hash-verified

956 */
957 setIndex(index: Array<number | string | (number | string)>, options?: { inplace?: boolean }): Series
958 setIndex(index: Array<number | string | (number | string)>, options?: { inplace?: boolean }): Series | void {
959 const { inplace } = { inplace: false, ...options }
960
961 if (!index) {
962 throw Error('Param Error: Must specify index array');
963 }
964
965 if (inplace) {
966 this.$setIndex(index)
967 } else {
968 const sf = this.copy();
969 sf.$setIndex(index)
970 return sf;
971 }
972 }
973
974
975 /**

Callers

nothing calls this directly

Calls 2

copyMethod · 0.95
$setIndexMethod · 0.65

Tested by

no test coverage detected