title: Passing string to dataframe iloc
body: <p>I have a <code>ProductDf</code> which have many versions of the same product. I want to filter the last iteration of the product. So I did this as below:</p>
  
  <pre><code>productIndexDf= ProductDf.groupby('productId').apply(lambda 
  x:x['startDtTime'].reset_index()).reset_index()        
  
  productToPick = productIndexDf.groupby('productId')['index'].max()
  </code></pre>
  
  <p>get the value of productToPick into a string</p>
  
  <pre><code>productIndex = productToPick.to_string(header=False, 
  index=False).replace('\n',' ')
  productIndex  = productIndex.split()
  
  productIndex = list(map(int, productIndex))
  productIndex.sort()
  
  productIndexStr = ','.join(str(e) for e in productIndex)
  </code></pre>
  
  <p>Once I get that in a Series, I call loc function manually and it works:</p>
  
  <pre><code>filteredProductDf = ProductDf.iloc[[7,8],:]
  </code></pre>
  
  <p>If I pass it the string, I get an error:</p>
  
  <pre><code>filteredProductDf = ProductDf.iloc[productIndexStr,:]
  </code></pre>
  
  <p><code>ValueError: Location based indexing can only have [integer, integer slice (START point is INCLUDED, END point is EXCLUDED), listlike of integers, boolean array] types</code></p>
  
  <p>I also tried this:</p>
  
  <pre><code>filteredProductDf = ProductDf[productIndexStr]
  </code></pre>
  
  <p>But then I get this issue:</p>
  
  <pre><code>KeyError: '7,8'
  </code></pre>