title: convert Int64Index to Int
body: <p>I'm iterating through a dataframe (called hdf) and applying changes on a row by row basis. hdf is sorted by group_id and assigned a 1 through n rank on some criteria.</p>
  
  <pre><code># Groupby function creates subset dataframes (a dataframe per distinct group_id).
  grouped = hdf.groupby('group_id')
  
  # Iterate through each subdataframe. 
  for name, group in grouped:
  
      # This grabs the top index for each subdataframe
      index1 = group[group['group_rank']==1].index
  
      # If criteria1 == 0, flag all rows for removal
      if(max(group['criteria1']) == 0):    
          for x in range(rank1, rank1 + max(group['group_rank'])):
              hdf.loc[x,'remove_row'] = 1
  </code></pre>
  
  <p>I'm getting the following error:</p>
  
  <pre><code>TypeError: int() argument must be a string or a number, not 'Int64Index'
  </code></pre>
  
  <p>I get the same error when I try to cast rank1 explicitly I get the same error:</p>
  
  <pre><code>rank1 = int(group[group['auction_rank']==1].index)
  </code></pre>
  
  <p>Can someone explain what is happening and provide an alternative?</p>