title: Read csv from Amazon s3 using python2.7
body: <p>I can easily get the bucket name from s3 but when I read the csv file from s3, it gives error every time.</p>
  
  <pre><code>import boto3
  import pandas as pd
  
  s3 = boto3.client('s3',
           aws_access_key_id='yyyyyyyy',
           aws_secret_access_key='xxxxxxxxxxx')
  # Call S3 to list current buckets
  response = s3.list_buckets()
  for bucket in response['Buckets']:
      print bucket['Name']
  
  output
  s3-bucket-data
  </code></pre>
  
  <p>.</p>
  
  <pre><code>import pandas as pd
  import StringIO
  from boto.s3.connection import S3Connection
  
  AWS_KEY = 'yyyyyyyyyy'
  AWS_SECRET = 'xxxxxxxxxx'
  aws_connection = S3Connection(AWS_KEY, AWS_SECRET)
  bucket = aws_connection.get_bucket('s3-bucket-data')
  
  fileName = "data.csv"
  
  content = bucket.get_key(fileName).get_contents_as_string()
  reader = pd.read_csv(StringIO.StringIO(content))
  </code></pre>
  
  <p>getting error- </p>
  
  <pre><code>boto.exception.S3ResponseError: S3ResponseError: 400 Bad Request
  </code></pre>
  
  <p>How I can read the csv from s3?</p>