I am new to nodejs and looking to loop through each row and subtract previous row cell using dataframe-js library.
const columns = ["x","y","gap"];
const df= new DataFrame(dict,columns);
df.sortBy(['y'], true);
df.map(row => row.set('gap', row.get('y') - row.get('y')-1));
You could do it like this:
Full code:
Produces: