title: HOW - to convert a python generator to pandas dataframe
body: <p>Im very new to python and pandas dataframe and im struggling to wrap my head around how to convert a python generator to a pandas dataframe.</p>
  
  <p>What i want to do is to fetch a large table into chunks with this function that yields a generator:</p>
  
  <pre><code>def fetch_data_into_chunks(cursor, arraysize=10**5):
      while True:
          results = cursor.fetchmany(arraysize)
          if not results:
              break
          for result in results:
              yield result
  </code></pre>
  
  <p>Then i want to append or concat the result to a pandas dataframe:</p>
  
  <pre><code>for data in fetch_data_into_chunks(cursor):
      df.append(data)
  </code></pre>
  
  <p>But this doesnt works and give me the error message:</p>
  
  <pre><code>TypeError: cannot concatenate object of type "&lt;class 'pyodbc.Row'&gt;"; only pd.Series, pd.DataFrame, and pd.Panel (deprecated) objs are valid
  </code></pre>
  
  <p>Thanks for the help!</p>