text: Q:
  
  using iterrows(), insert a subset of columns from a single row of a dataframe as a new row in another dataframe
  
  I need to select 3 columns from a single row of a 6-column dataframe and append it to another dataframe that has only 3 columns.
  import pandas
  import numpy
  
  df1 = pd.DataFrame({'Name':['Sanjay','Robin','Hugo'],
                      'Email':['s@email.com','r@email.com','h@email.com'],
                      'OrderNo':[23,234,66],
                      'Address':['234 West Ave','45 Oak Street','Rt. 3443 FM290'],
                      'Phone':['555-1212','555-3322','555-6655'],
                      'Age':[34,23,65]})
  
  df2 = pd.DataFrame(columns = ['Name', 'OrderNo', 'Phone'])
  
  for index, row in df1.iterrows():
      if index == 0:
          df2 = df2.append(row[0,2,4])
          #df2 = df2.append(row['Name','OrderNo','Phone'])  <------also threw key error
  
  print(df2)
  
  Here's what I was hoping to see:
       Name  OrderNo     Phone
  0  Sanjay       23  555-1212
  
  Here's the output from this exercise:
  Traceback (most recent call last):
    File "/Users/Joe/anaconda3/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 3109, in get_value
      return libindex.get_value_box(s, key)
    File "pandas/_libs/index.pyx", line 55, in pandas._libs.index.get_value_box
    File "pandas/_libs/index.pyx", line 63, in pandas._libs.index.get_value_box
  TypeError: 'tuple' object cannot be interpreted as an integer
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "<string>", line 15, in <module>
    File "/Users/Joe/anaconda3/lib/python3.6/site-packages/pandas/core/series.py", line 766, in __getitem__
      result = self.index.get_value(self, key)
    File "/Users/Joe/anaconda3/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 3117, in get_value
      raise e1
    File "/Users/Joe/anaconda3/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 3103, in get_value
      tz=getattr(series.dtype, 'tz', None))
    File "pandas/_libs/index.pyx", line 106, in pandas._libs.index.IndexEngine.get_value
    File "pandas/_libs/index.pyx", line 114, in pandas._libs.index.IndexEngine.get_value
    File "pandas/_libs/index.pyx", line 162, in pandas._libs.index.IndexEngine.get_loc
    File "pandas/_libs/hashtable_class_helper.pxi", line 1492, in pandas._libs.hashtable.PyObjectHashTable.get_item
    File "pandas/_libs/hashtable_class_helper.pxi", line 1500, in pandas._libs.hashtable.PyObjectHashTable.get_item
  KeyError: (0, 2, 4)
  
  A:
  
  You can also use the DataFrame.append() function:
  df2=df2.append(df1[['Name', 'OrderNo', 'Phone']].iloc[0])
  df2
  
      Name    OrderNo Phone
  0   Sanjay  23  555-1212
  
  