javascriptdata / danfojs

Danfo.js is an open source, JavaScript library providing high performance, intuitive, and easy to use data structures for manipulating and processing structured data.
https://danfo.jsdata.org/
MIT License
4.81k stars 209 forks source link

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

Open LSW1980 opened 1 year ago

LSW1980 commented 1 year ago

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