Question: Design a DataTable with a loop

I'm trying to make a table of values as a data table.  The problem is that it's making more rows than loops, I'm not able to make an empty DataFrame, and that I have to add an extra row to align the values, so I need to remove a row, and change the indexes.  Any help with making data tables work properly, would be greatly appreciated.

```

newt := x -> evalf(x - f(x)/D(f)(x));

f:= x -> x^6-2; # function to analyze

rt[0] := 1.5; #x0 value


n_error[0]:=1.5-newt(1.5): #error of first estimate
     

DF := DataFrame( <x|n_error>):# create a dataframe to store estimates, and error rates
for count from 0 to 10 do; nerror[count]:=abs(x[count]-x[count-1]);    rt[count]:=x[count-1];
x[count + 1] := newt(x[count]); DF:=Append(DF,DataSeries(<rt[count]|nerror[count]>),mode=row);    
end do:

NewtonData:=DataFrame(Remove( DF, 2, mode=row)):
NewtonData


```

Please Wait...