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

Method resetIndex

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

Source from the content-addressed store, hash-verified

2501 */
2502 resetIndex(options?: { inplace?: boolean }): DataFrame
2503 resetIndex(options?: { inplace?: boolean }): DataFrame | void {
2504 const { inplace } = { inplace: false, ...options }
2505
2506 if (inplace) {
2507 this.$resetIndex()
2508 } else {
2509 const df = new DataFrame(this.values,
2510 {
2511 index: this.index.map((_, i) => i),
2512 columns: [...this.columns],
2513 dtypes: [...this.dtypes],
2514 config: { ...this.config }
2515 });
2516 return df;
2517 }
2518
2519 }
2520
2521 /**
2522 * Apply a function along an axis of the DataFrame. To apply a function element-wise, use `applyMap`.

Callers

nothing calls this directly

Calls 2

$resetIndexMethod · 0.65
mapMethod · 0.65

Tested by

no test coverage detected