DataFrame.resetIndex

Resets the index of the DataFrame, and use the default one instead.

danfo.DataFrame.resetIndex(options)

Parameters
Type
Description
Default

options

Object

{

inplace: Boolean indicating whether to perform the operation inplace or not. Defaults to false

}

{ inplace: false}

Returns:

**** return DataFrame

Examples

const dfd = require("danfojs-node")

let data = {
    "A": [-20, 30, 47.3],
    "B": [34, 5, 6],
    "C": [20, 3, 30]
}


let df = new dfd.DataFrame(data, { index: ["a", "b", "c"] })
df.print()

df.resetIndex({ inplace: true }) //inplace
//df = df.resetIndex() //not in inplace

df.print()

Last updated

Was this helpful?