AnsweredAssumed Answered

Field Calculation arcpy

Question asked by purid on Jul 9, 2012
Latest reply on Jul 10, 2012 by purid
Hi

I am developing a script to calculate the values of two fields (C and D) based on value of  field A:

A     C    D
0.2  1    1
0.2  1    2
0.2  1    3
0.4  2    1
0.5  3    1
0.5  3    2

So the idea is

n = 1
k =0
while i < endrow
{
  if a[i]==a[i+1]
     c[i]=n
     d[i] = k+1
if a[i] < a[i+1]
     i=i+1
     k=0
     c[i]=n+1
     d[i]= k+1
}

Not sure - cursor can help me. But is there any way for such comparison and update the column?

Thanks

Outcomes