UNPKG

@jrc03c/js-math-tools

Version:
15 lines (10 loc) 330 B
import { range } from "../range.mjs" function dfResetIndex(df, shouldSkipCopying) { const out = shouldSkipCopying ? df : df.copy() const n = (out.index.length - 1).toString().length out.index = range(0, df.shape[0]).map(i => { return "row" + i.toString().padStart(n, "0") }) return out } export { dfResetIndex }