title: How to read a compressed csv-file with pandas read_csv in Watson Studio?
body: <p>To read a zip-compressed csv-file with pandas in my local Jupyter notebook I execute:</p>
  
  <pre class="lang-py prettyprint-override"><code>import pandas as pd
  pd.read_csv('csv_file.zip')
  </code></pre>
  
  <p>However, in Watson Studio, <code>read_csv()</code> throws an exception when I replace a filename with a cloud object storage streaming object.</p>
  
  <p>This is the first cell of my notebook in Watson Studio:</p>
  
  <pre class="lang-py prettyprint-override"><code>import types
  from ibm_botocore.client import Config
  import ibm_boto3
  
  def __iter__(self): return 0
  
  client = ibm_boto3.client(service_name='s3', ibm_api_key_id='...',
      ibm_auth_endpoint="...", config=Config(signature_version='oauth'),
      endpoint_url='...')
  
  body = client.get_object(Bucket='...', Key='csv_file.zip')['Body']
  if not hasattr(body, "__iter__"):
      body.__iter__ = types.MethodType( __iter__, body )
  </code></pre>
  
  <p>Now, when I try:</p>
  
  <pre class="lang-py prettyprint-override"><code>import pandas as pd
  df = pd.read_csv(body)
  </code></pre>
  
  <p>I get:</p>
  
  <pre class="lang-none prettyprint-override"><code>'utf-8' codec can't decode byte 0xbb in position 0: invalid start byte
  </code></pre>
  
  <p>If I specify <code>compression='zip'</code>:</p>
  
  <pre class="lang-py prettyprint-override"><code>import pandas as pd
  df = pd.read_csv(body, compression='zip')
  </code></pre>
  
  <p>the message is:</p>
  
  <pre class="lang-none prettyprint-override"><code>'StreamingBody' object has no attribute 'seek'
  </code></pre>
  
  <p>Is there a direct way to <code>read_csv()</code> a zipped file in Watson Studio without explicitly writing an unpacking code?</p>
  
  <p>(The <code>pd.__version__</code> is <code>0.21.0</code> in both environments.)</p>