code: def com_find(ar_grid):
      
      f_x = 0
      f_y = 0
      f_m = 0
  
      for i in range(len(ar_grid)):
         for j in range(len(ar_grid[i])):
           if ar_grid[i][j]:
              # Since python arrays are zero indexed, we need to offset
              # the loop counters by 1 to account for mass in the 1st
              # column.
              f_x += (j+1) * ar_grid[i][j]
              f_y += (i+1) * ar_grid[i][j]
              f_m += ar_grid[i][j]
      f_com = array( (float(f_x)/f_m , float(f_y)/f_m) )
      return f_com
docs: Find the center of mass in array grid <ar_grid>. Mass elements
      are grid index values.
  
      Return an array, in format (x, y), i.e. col, row!