How can I read tar.gz file using pandas read_csv with gzip compression option? : <p>I have a very simple csv, with the following data, compressed inside the tar.gz file. I need to read that in dataframe using pandas.read_csv.  </p>

<pre><code>   A  B
0  1  4
1  2  5
2  3  6

import pandas as pd
pd.read_csv("sample.tar.gz",compression='gzip')
</code></pre>

<p>However, I am getting error:</p>

<pre><code>CParserError: Error tokenizing data. C error: Expected 1 fields in line 440, saw 2
</code></pre>

<p>Following are the set of read_csv commands and the different errors I get with them:</p>

<pre><code>pd.read_csv("sample.tar.gz",compression='gzip',  engine='python')
Error: line contains NULL byte

pd.read_csv("sample.tar.gz",compression='gzip', header=0)
CParserError: Error tokenizing data. C error: Expected 1 fields in line 440, saw 2

pd.read_csv("sample.tar.gz",compression='gzip', header=0, sep=" ")
CParserError: Error tokenizing data. C error: Expected 2 fields in line 94, saw 14    

pd.read_csv("sample.tar.gz",compression='gzip', header=0, sep=" ", engine='python')
Error: line contains NULL byte
</code></pre>

<p>What's going wrong here? How can I fix this?</p>
