title: Error Message: cannot do slice indexing on <class 'pandas.core.indexes.range.RangeIndex'> with these indexers [[ 2]] of <class 'numpy.ndarray'>
body: <p>I want to copy rows from one dataframe to another based on the indices stored in an array. While using the following code:</p>
  
  <pre><code>df1=pd.DataFrame(
     {
          "column_1": [1, 2, 3, 4],
          "column_2": ['A','B','C','D'],
          "column_3": [3.1, 7.8, 9.0, 5.8]
     }
  )
     Arr1=np.array([[2],[3]])
  
     column_name = ['column_2','column_3'];
     index_row=range(4);
     df2 = pd.DataFrame(index=index_row,columns=column_name);
  
     for i in range(4):
            df2[i:i+1]=df1[(Arr1[i]):(Arr1[i]+1)]
  </code></pre>
  
  <p>I get the following error: cannot do slice indexing on class 'pandas.core.indexes.range.RangeIndex' with these indexers [[2]] of class 'numpy.ndarray'.</p>
  
  <p>Can someone suggest a correct approach?</p>