title: Python loads data from Redshift to S3
body: <p>I am trying to load some Redshift query results to S3. So far I am using pandas_redshift but I got stuck:</p>
  
  <pre><code>import pandas_redshift as pr
  
  pr.connect_to_redshift( dbname = 'dbname',
                      host = 'xxx.us-east-    1.redshift.amazonaws.com',
                      port = 5439,
                      user = 'xxx',
                      password = 'xxx')
  
  pr.connect_to_s3(aws_access_key_id = 'xxx',
              aws_secret_access_key = 'xxx',
              bucket = 'dxxx',
              subdirectory = 'dir')
  </code></pre>
  
  <p>And here is the data that I want to dump to S3:</p>
  
  <pre><code>sql_statement = '''
  select
  provider,
  provider_code 
  from db1.table1
  group by provider, provider_code;
  
  '''
  df = pr.redshift_to_pandas(sql_statement)
  </code></pre>
  
  <p>The df was created successfully but how to do the next step, which is to put this dataframe to S3?</p>