Gmousse / dataframe-js

No Maintenance Intended
https://gmousse.gitbooks.io/dataframe-js/
MIT License
460 stars 38 forks source link

[QUESTION] How to modify large dataframe >inplace< #102

Open Zuckerbrot opened 4 years ago

Zuckerbrot commented 4 years ago

Hi, firstly thanks for this great library. I am wondering if there is a way to modify rows inplace. Each time using df.setRow(1, row => row.set("y", 33)) to set column "y" in row 1 to value 33 a new dataframe object is created.

Is there a way to avoid this and directly modify the existing object?

Thanks!

Gmousse commented 4 years ago

Hi @Zuckerbrot, Indeed, the current usage doesn't allow direct mutation or property modification. I must look if it's possible to implement it easily.

Gmousse commented 4 years ago

Hi again,

I have added a new method DataFrame.setRowInPlace (with the same usage) mutating directly the existing DataFrame on the develop branch (you can switch on it to test).

I will look to add other usage like this.