<p dir="auto">I'm using pandas 0.5.0 with python 2.7 on archlinux.<br>
This example file seems pretty standard and it opens well in Libreoffice: <a href="http://dl.dropbox.com/u/40028/countrycode.csv" rel="nofollow">http://dl.dropbox.com/u/40028/countrycode.csv</a></p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import pandas
cc = pandas.read_csv('countrycode.csv', index_col=1)
cc
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (1224, 0))

Out[31]: ---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/[path/to/file/anonymized/manually/by/me]/&lt;ipython-input-31-870c06c00566&gt; in &lt;module&gt;()
----&gt; 1 cc

/usr/lib/python2.7/site-packages/IPython/core/displayhook.py in __call__(self, result)
    300             self.start_displayhook()
    301             self.write_output_prompt()
--&gt; 302             format_dict = self.compute_format_data(result)
    303             self.write_format_data(format_dict)
    304             self.update_user_ns(result)

/usr/lib/python2.7/site-packages/IPython/core/displayhook.py in compute_format_data(self, result)
    213             MIME type representation of the object.
    214         &quot;&quot;&quot;
--&gt; 215         return self.shell.display_formatter.format(result)
    216 
    217     def write_format_data(self, format_dict):

/usr/lib/python2.7/site-packages/IPython/core/formatters.py in format(self, obj, include, exclude)
    120                     continue
    121             try:
--&gt; 122                 data = formatter(obj)
    123             except:
    124                 # FIXME: log the exception


/usr/lib/python2.7/site-packages/IPython/core/formatters.py in __call__(self, obj)
    441                 type_pprinters=self.type_printers,
    442                 deferred_pprinters=self.deferred_printers)
--&gt; 443             printer.pretty(obj)
    444             printer.flush()
    445             return stream.getvalue()

/usr/lib/python2.7/site-packages/IPython/lib/pretty.py in pretty(self, obj)
    349             if hasattr(obj_class, '_repr_pretty_'):
    350                 return obj_class._repr_pretty_(obj, self, cycle)
--&gt; 351             return _default_pprint(obj, self, cycle)
    352         finally:
    353             self.end_group()

/usr/lib/python2.7/site-packages/IPython/lib/pretty.py in _default_pprint(obj, p, cycle)
    467     if getattr(klass, '__repr__', None) not in _baseclass_reprs:
    468         # A user-provided repr.

--&gt; 469         p.text(repr(obj))
    470         return
    471     p.begin_group(1, '&lt;')

/usr/lib/python2.7/site-packages/pandas/core/frame.pyc in __repr__(self)
    263         buf = StringIO()
    264         if len(self.index) &lt; 500 and len(self.columns) &lt;= 10:
--&gt; 265             self.to_string(buf=buf)
    266         else:
    267             self.info(buf=buf, verbose=self._verbose_info)

/usr/lib/python2.7/site-packages/pandas/core/frame.pyc in to_string(self, buf, columns, colSpace, na_rep, formatters, float_format, sparsify, nanRep, index_names)
    569                                         float_format=float_format,
    570                                         sparsify=sparsify,
--&gt; 571                                         index_names=index_names)
    572 
    573         if buf is None:

/usr/lib/python2.7/site-packages/pandas/core/frame.pyc in __init__(self, frame, buf, columns, col_space, na_rep, formatters, float_format, sparsify, index_names)
   2943         self.column_filter = frame.columns if columns is None else set(columns)
   2944 
-&gt; 2945         self._write_to_buffer()
   2946 
   2947     def _write_to_buffer(self):

/usr/lib/python2.7/site-packages/pandas/core/frame.pyc in _write_to_buffer(self)
   2956         else:
   2957             # may include levels names also

-&gt; 2958             str_index = self._get_formatted_index()
   2959             str_columns = self._get_formatted_column_labels()
   2960 

/usr/lib/python2.7/site-packages/pandas/core/frame.pyc in _get_formatted_index(self)
   3035                                      names=show_index_names)
   3036         else:
-&gt; 3037             fmt_index = [index.format(name=show_index_names)]
   3038 
   3039         adjoined = adjoin(1, *fmt_index).split('\n')

TypeError: format() got an unexpected keyword argument 'name'"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">pandas</span>
<span class="pl-s1">cc</span> <span class="pl-c1">=</span> <span class="pl-s1">pandas</span>.<span class="pl-en">read_csv</span>(<span class="pl-s">'countrycode.csv'</span>, <span class="pl-s1">index_col</span><span class="pl-c1">=</span><span class="pl-c1">1</span>)
<span class="pl-s1">cc</span>
<span class="pl-v">ERROR</span>: <span class="pl-v">An</span> <span class="pl-s1">unexpected</span> <span class="pl-s1">error</span> <span class="pl-s1">occurred</span> <span class="pl-k">while</span> <span class="pl-s1">tokenizing</span> <span class="pl-s1">input</span>
<span class="pl-v">The</span> <span class="pl-s1">following</span> <span class="pl-s1">traceback</span> <span class="pl-s1">may</span> <span class="pl-s1">be</span> <span class="pl-s1">corrupted</span> <span class="pl-c1">or</span> <span class="pl-s1">invalid</span>
<span class="pl-v">The</span> <span class="pl-s1">error</span> <span class="pl-s1">message</span> <span class="pl-c1">is</span>: (<span class="pl-s">'EOF in multi-line statement'</span>, (<span class="pl-c1">1224</span>, <span class="pl-c1">0</span>))

<span class="pl-v">Out</span>[<span class="pl-c1">31</span>]: <span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span>
<span class="pl-v">TypeError</span>                                 <span class="pl-v">Traceback</span> (<span class="pl-s1">most</span> <span class="pl-s1">recent</span> <span class="pl-s1">call</span> <span class="pl-s1">last</span>)
<span class="pl-c1">/</span>[<span class="pl-s1">path</span><span class="pl-c1">/</span><span class="pl-s1">to</span><span class="pl-c1">/</span><span class="pl-s1">file</span><span class="pl-c1">/</span><span class="pl-s1">anonymized</span><span class="pl-c1">/</span><span class="pl-s1">manually</span><span class="pl-c1">/</span><span class="pl-s1">by</span><span class="pl-c1">/</span><span class="pl-s1">me</span>]<span class="pl-c1">/</span><span class="pl-c1">&lt;</span><span class="pl-s1">ipython</span><span class="pl-c1">-</span><span class="pl-s1">input</span><span class="pl-c1">-</span><span class="pl-c1">31</span><span class="pl-c1">-</span><span class="pl-c1">870</span><span class="pl-s1">c06c00566</span><span class="pl-c1">&gt;</span> <span class="pl-s1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span>()
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">1</span> <span class="pl-s1">cc</span>

<span class="pl-c1">/</span><span class="pl-s1">usr</span><span class="pl-c1">/</span><span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">python2</span>.<span class="pl-c1">7</span><span class="pl-c1">/</span><span class="pl-s1">site</span><span class="pl-c1">-</span><span class="pl-s1">packages</span><span class="pl-c1">/</span><span class="pl-v">IPython</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">displayhook</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">__call__</span>(<span class="pl-s1">self</span>, <span class="pl-s1">result</span>)
    <span class="pl-c1">300</span>             <span class="pl-s1">self</span>.<span class="pl-en">start_displayhook</span>()
    <span class="pl-c1">301</span>             <span class="pl-s1">self</span>.<span class="pl-en">write_output_prompt</span>()
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">302</span>             <span class="pl-s1">format_dict</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-en">compute_format_data</span>(<span class="pl-s1">result</span>)
    <span class="pl-c1">303</span>             <span class="pl-s1">self</span>.<span class="pl-en">write_format_data</span>(<span class="pl-s1">format_dict</span>)
    <span class="pl-c1">304</span>             <span class="pl-s1">self</span>.<span class="pl-en">update_user_ns</span>(<span class="pl-s1">result</span>)

<span class="pl-c1">/</span><span class="pl-s1">usr</span><span class="pl-c1">/</span><span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">python2</span>.<span class="pl-c1">7</span><span class="pl-c1">/</span><span class="pl-s1">site</span><span class="pl-c1">-</span><span class="pl-s1">packages</span><span class="pl-c1">/</span><span class="pl-v">IPython</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">displayhook</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">compute_format_data</span>(<span class="pl-s1">self</span>, <span class="pl-s1">result</span>)
    <span class="pl-c1">213</span>             <span class="pl-v">MIME</span> <span class="pl-s1">type</span> <span class="pl-s1">representation</span> <span class="pl-s1">of</span> <span class="pl-s1">the</span> <span class="pl-s1">object</span>.
    <span class="pl-c1">214</span>         """
--&gt; 215         return self.shell.display_formatter.format(result)
    216 
    217     def write_format_data(self, format_dict):

/usr/lib/python2.7/site-packages/IPython/core/formatters.py in format(self, obj, include, exclude)
    120                     continue
    121             try:
--&gt; 122                 data = formatter(obj)
    123             except:
    124                 # FIXME: log the exception


/usr/lib/python2.7/site-packages/IPython/core/formatters.py in __call__(self, obj)
    441                 type_pprinters=self.type_printers,
    442                 deferred_pprinters=self.deferred_printers)
--&gt; 443             printer.pretty(obj)
    444             printer.flush()
    445             return stream.getvalue()

/usr/lib/python2.7/site-packages/IPython/lib/pretty.py in pretty(self, obj)
    349             if hasattr(obj_class, '_repr_pretty_'):
    350                 return obj_class._repr_pretty_(obj, self, cycle)
--&gt; 351             return _default_pprint(obj, self, cycle)
    352         finally:
    353             self.end_group()

/usr/lib/python2.7/site-packages/IPython/lib/pretty.py in _default_pprint(obj, p, cycle)
    467     if getattr(klass, '__repr__', None) not in _baseclass_reprs:
    468         # A user-provided repr.

--&gt; 469         p.text(repr(obj))
    470         return
    471     p.begin_group(1, '&lt;')

/usr/lib/python2.7/site-packages/pandas/core/frame.pyc in __repr__(self)
    263         buf = StringIO()
    264         if len(self.index) &lt; 500 and len(self.columns) &lt;= 10:
--&gt; 265             self.to_string(buf=buf)
    266         else:
    267             self.info(buf=buf, verbose=self._verbose_info)

/usr/lib/python2.7/site-packages/pandas/core/frame.pyc in to_string(self, buf, columns, colSpace, na_rep, formatters, float_format, sparsify, nanRep, index_names)
    569                                         float_format=float_format,
    570                                         sparsify=sparsify,
--&gt; 571                                         index_names=index_names)
    572 
    573         if buf is None:

/usr/lib/python2.7/site-packages/pandas/core/frame.pyc in __init__(self, frame, buf, columns, col_space, na_rep, formatters, float_format, sparsify, index_names)
   2943         self.column_filter = frame.columns if columns is None else set(columns)
   2944 
-&gt; 2945         self._write_to_buffer()
   2946 
   2947     def _write_to_buffer(self):

/usr/lib/python2.7/site-packages/pandas/core/frame.pyc in _write_to_buffer(self)
   2956         else:
   2957             # may include levels names also

-&gt; 2958             str_index = self._get_formatted_index()
   2959             str_columns = self._get_formatted_column_labels()
   2960 

/usr/lib/python2.7/site-packages/pandas/core/frame.pyc in _get_formatted_index(self)
   3035                                      names=show_index_names)
   3036         else:
-&gt; 3037             fmt_index = [index.format(name=show_index_names)]
   3038 
   3039         adjoined = adjoin(1, *fmt_index).split('<span class="pl-cce">\n</span>')

<span class="pl-v">TypeError</span>: <span class="pl-s1">format</span>() <span class="pl-s1">got</span> <span class="pl-s1">an</span> <span class="pl-s1">unexpected</span> <span class="pl-s1">keyword</span> <span class="pl-s1">argument</span> <span class="pl-s">'name'</span></pre></div>
<p dir="auto">Encountered via a column with all missing values read from a CSV that are filled by pd.csv_read as NaNs. I had logic to check for duplicate values that used set(df[col]), which I realize I can readily replace with df[col].unique(). However, found an intriguing bug, in that a lengthy list of np.NaN appears to hang the kernel... one core maxes at 100% and just sits there with the fans blasting.</p>
<p dir="auto">This only seems to occur with NaNs... a similar list of integers or floats will chug but ultimately return.</p>
<p dir="auto">System is a Gigabyte Aero 15 running Ubuntu 16.04<br>
Python 3.6.1<br>
Pandas 0.20.1<br>
NumPy 1.13.1</p>
<p dir="auto">Minimal reproduction</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import pandas as pd
import numpy as np 
ser = pd.Series([np.NaN]*1000000)
set(ser)"><pre class="notranslate"><code class="notranslate">import pandas as pd
import numpy as np 
ser = pd.Series([np.NaN]*1000000)
set(ser)
</code></pre></div>
<p dir="auto">I mean, this is really just an entertaining curiosity, as behavior with .unique is fine. Still intriguing, though. Any ideas?</p>