title: How to fix 'generator' object has no attribute 'to_csv' when exporting dataframe
body: <p>I am using Python to export data from an Oracle table into a Pandas DataFrame and then a CSV file. </p>
  
  <p>But I am receiving this error:</p>
  
  <pre><code>AttributeError: 'generator' object has no attribute 'to_csv'
  </code></pre>
  
  <p>I can't find out where the problem with my code is:</p>
  
  <pre><code>import cx_Oracle
  import csv
  import pandas as pd
  import sqlalchemy
  from sqlalchemy import create_engine
  
  DATABASE = "MY database"
  SCHEMA   = "MY USER"
  PASSWORD = "MY PASS"
  connstr  = "oracle://{}:{}@{}".format(SCHEMA, PASSWORD, DATABASE)
  conn     = sqlalchemy.create_engine(connstr)
  result=pd.read_sql('My QUERY' , con=conn, chunksize=10000)
  result.to_csv("test",sep=',',chunksize=10000)
  </code></pre>