title: Adding new sequential ID numbers based on sorted data (ArcGIS)
body: <p>I need a line of code that will issue new sequential id's based on the order I've prescribed to my data. Essentially, after having sorted my data to my liking, the original Object_Id's are no longer in a meaningful order to me. In my table I created a new field (short integer). In the pre logic script box of the field calculator I attempted the following:</p>
  
  <pre><code>counter = 0
   def uniqueID():
   global counter
   counter += 1
   return counter
  </code></pre>
  
  <p>But it didn't seem to work.. A little sample of what my table looks like is as follows: (for visualization purposes)</p>
  
  <pre><code>Object_ID    /    MMSI    /    TIME    /    VESSEL    /    NEW_ID
  
    1210            4444       01/10/10         01            NuLL
    1801            4444       02/10/10         01            NuLL
     303            4444       03/10/10         01            NuLL
    2839            4444       03/10/10         01            NuLL
   32100            5555       01/10/10         03            NuLL
      34            5555       02/10/10         03            NuLL
  </code></pre>
  
  <p>In essence I need those NuLL's to now be 1, 2, 3, 4... etc etc. as my data is now ordered to my liking (first by MMSI number/within MMSI by date) </p>
  
  <p><strong>So, it would look as follows after:</strong> (notice the New_ID field is now populated) </p>
  
  <pre><code>Object_ID    /    MMSI    /    TIME    /    VESSEL    /    NEW_ID
  
    1210            4444       01/10/10         01            1
    1801            4444       02/10/10         01            2
     303            4444       03/10/10         01            3
    2839            4444       03/10/10         01            4
   32100            5555       01/10/10         03            5
      34            5555       02/10/10         03            6
  </code></pre>
  
  <p>how would I accomplish this? thanks</p>