Pandas: How to open certain files
<p>I am currently working on the data set from this <a href="https://github.com/smarthi/UnivOfWashington-Machine-Learning/tree/master/MLFoundations/week4/people_wiki.gl" rel="nofollow">link</a>. But I am unable to read these files from Pandas? Has anyone tried to play with such files?</p>

<p>I am trying the following:</p>

<pre><code>import pandas as pd

df = pd.read_csv("m_4549381c276b46c6.0000")
</code></pre>

<p>But I get the following error</p>

<pre><code>Error tokenizing data. C error: Buffer overflow caught - possible malformed input file.
</code></pre>

<p>Just clarifying on the answer by <a href="http://stackoverflow.com/a/39686244/6842947">MaxU</a>, you are trying to read it the wrong way. It is a raw file and its formatting is contained in the other files which are there in the same folder in that <a href="https://github.com/smarthi/UnivOfWashington-Machine-Learning/tree/master/MLFoundations/week4/people_wiki.gl" rel="nofollow">link</a>. Pandas requires you to know the encoded format of the file beforehand (i.e delimiters, number of columns etc). It cannot be used as a magic wand to read any file without being aware of it.</p>

<p>The IPython notebook just outside the folder in your <a href="https://github.com/smarthi/UnivOfWashington-Machine-Learning/tree/master/MLFoundations/week4/people_wiki.gl" rel="nofollow">link</a>, shows exactly how to read that data. <a href="http://stackoverflow.com/a/39686244/6842947">MaxU</a> has correctly mentioned that the specific file in question is just a part of the SFrame which is a structure of GraphLab framework. Hence, you are trying to extract meaningful data just from a part of the whole and hence you can't do that meaningfully.</p>

<p>You can however read the graphlab file and convert it into a Pandas dataframe. For details see <a href="http://stackoverflow.com/questions/33461953/opening-folder-with-gl-extension-in-python-or-pandas">here</a>.</p>

python python-2.7 pandas dataframe