danfojs icon indicating copy to clipboard operation
danfojs copied to clipboard

Does df.fillNa() turn on { inplace: true } by default?

Open LSW1980 opened this issue 2 years ago • 1 comments

Does df.fillNa() turn on { inplace: true } by default?

[Getting Started - Danfo.js] section "Filling missing values in specific columns with specific values:"

const dfd = require("danfojs-node")

let data = { "Name": ["Apples", "Mango", "Banana", NaN], "Count": [NaN, 5, NaN, 10], "Price": [200, 300, 40, 250] }

let df = new dfd.DataFrame(data) df.print()

let df_filled = df.fillNa(["Apples", df["Count"].mean()], { columns: ["Name", "Count"] }) df_filled.print()

if we try df.print() again, it is the same as df_filled? So, df.fillNa() turn on { inplace: true } by default? Is this normal?

Thank you

LSW1980 avatar Oct 24 '23 20:10 LSW1980

This is a bug, thanks for raising. It should be using false by default.

risenW avatar Apr 02 '25 17:04 risenW