<p dir="auto">We've found a problem where repeating a row and a column in a DataFrame fails with a "Cannot create BlockManager._ref_locs" assertion error.</p>
<p dir="auto">The dataframe is very simple:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="df = pd.DataFrame(np.arange(25.).reshape(5,5),
                            index=['a', 'b', 'c', 'd', 'e'],
                            columns=['a', 'b', 'c', 'd', 'e'])"><pre class="notranslate"><span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-s1">np</span>.<span class="pl-en">arange</span>(<span class="pl-c1">25.</span>).<span class="pl-en">reshape</span>(<span class="pl-c1">5</span>,<span class="pl-c1">5</span>),
                            <span class="pl-s1">index</span><span class="pl-c1">=</span>[<span class="pl-s">'a'</span>, <span class="pl-s">'b'</span>, <span class="pl-s">'c'</span>, <span class="pl-s">'d'</span>, <span class="pl-s">'e'</span>],
                            <span class="pl-s1">columns</span><span class="pl-c1">=</span>[<span class="pl-s">'a'</span>, <span class="pl-s">'b'</span>, <span class="pl-s">'c'</span>, <span class="pl-s">'d'</span>, <span class="pl-s">'e'</span>])</pre></div>
<p dir="auto">And we pull the data out like this:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="z = df[['a', 'c', 'a']]
z.ix[['a', 'c', 'a']]
Traceback (most recent call last):
  File &quot;/users/is/dbew/pyenvs/timeseries/lib/python2.7/site-packages/ipython-1.1.0_1_ahl1-py2.7.egg/IPython/core/interactiveshell.py&quot;, line 2830, in run_code
    exec code_obj in self.user_global_ns, self.user_ns
  File &quot;&lt;ipython-input-87-3bdc0aacc4b5&gt;&quot;, line 1, in &lt;module&gt;
    z.ix[['a', 'c', 'a']]
  File &quot;/users/is/dbew/pyenvs/timeseries/lib/python2.7/site-packages/pandas-0.13.0_292_g4dcecb0-py2.7-linux-x86_64.egg/pandas/core/indexing.py&quot;, line 56, in __getitem__
    return self._getitem_axis(key, axis=0)
  File &quot;/users/is/dbew/pyenvs/timeseries/lib/python2.7/site-packages/pandas-0.13.0_292_g4dcecb0-py2.7-linux-x86_64.egg/pandas/core/indexing.py&quot;, line 744, in _getitem_axis
    return self._getitem_iterable(key, axis=axis)
  File &quot;/users/is/dbew/pyenvs/timeseries/lib/python2.7/site-packages/pandas-0.13.0_292_g4dcecb0-py2.7-linux-x86_64.egg/pandas/core/indexing.py&quot;, line 816, in _getitem_iterable
    convert=False)
  File &quot;/users/is/dbew/pyenvs/timeseries/lib/python2.7/site-packages/pandas-0.13.0_292_g4dcecb0-py2.7-linux-x86_64.egg/pandas/core/generic.py&quot;, line 1164, in take
    new_data = self._data.take(indices, axis=baxis)
  File &quot;/users/is/dbew/pyenvs/timeseries/lib/python2.7/site-packages/pandas-0.13.0_292_g4dcecb0-py2.7-linux-x86_64.egg/pandas/core/internals.py&quot;, line 3366, in take
    ref_items=new_axes[0], axis=axis)
  File &quot;/users/is/dbew/pyenvs/timeseries/lib/python2.7/site-packages/pandas-0.13.0_292_g4dcecb0-py2.7-linux-x86_64.egg/pandas/core/internals.py&quot;, line 2337, in apply
    do_integrity_check=do_integrity_check)
  File &quot;/users/is/dbew/pyenvs/timeseries/lib/python2.7/site-packages/pandas-0.13.0_292_g4dcecb0-py2.7-linux-x86_64.egg/pandas/core/internals.py&quot;, line 1990, in __init__
    self._set_ref_locs(do_refs=True)
  File &quot;/users/is/dbew/pyenvs/timeseries/lib/python2.7/site-packages/pandas-0.13.0_292_g4dcecb0-py2.7-linux-x86_64.egg/pandas/core/internals.py&quot;, line 2130, in _set_ref_locs
    'have _ref_locs set' % (block, labels))
AssertionError: Cannot create BlockManager._ref_locs because block [FloatBlock: [a], 1 x 3, dtype: float64] with duplicate items [Index([u'a', u'c', u'a'], dtype='object')] does not have _ref_locs set"><pre class="notranslate"><span class="pl-s1">z</span> <span class="pl-c1">=</span> <span class="pl-s1">df</span>[[<span class="pl-s">'a'</span>, <span class="pl-s">'c'</span>, <span class="pl-s">'a'</span>]]
<span class="pl-s1">z</span>.<span class="pl-s1">ix</span>[[<span class="pl-s">'a'</span>, <span class="pl-s">'c'</span>, <span class="pl-s">'a'</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-v">File</span> <span class="pl-s">"/users/is/dbew/pyenvs/timeseries/lib/python2.7/site-packages/ipython-1.1.0_1_ahl1-py2.7.egg/IPython/core/interactiveshell.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">2830</span>, <span class="pl-s1">in</span> <span class="pl-s1">run_code</span>
    <span class="pl-s1">exec</span> <span class="pl-s1">code_obj</span> <span class="pl-c1">in</span> <span class="pl-s1">self</span>.<span class="pl-s1">user_global_ns</span>, <span class="pl-s1">self</span>.<span class="pl-s1">user_ns</span>
  <span class="pl-v">File</span> <span class="pl-s">"&lt;ipython-input-87-3bdc0aacc4b5&gt;"</span>, <span class="pl-s1">line</span> <span class="pl-c1">1</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-s1">z</span>.<span class="pl-s1">ix</span>[[<span class="pl-s">'a'</span>, <span class="pl-s">'c'</span>, <span class="pl-s">'a'</span>]]
  <span class="pl-v">File</span> <span class="pl-s">"/users/is/dbew/pyenvs/timeseries/lib/python2.7/site-packages/pandas-0.13.0_292_g4dcecb0-py2.7-linux-x86_64.egg/pandas/core/indexing.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">56</span>, <span class="pl-s1">in</span> <span class="pl-s1">__getitem__</span>
    <span class="pl-k">return</span> <span class="pl-s1">self</span>.<span class="pl-en">_getitem_axis</span>(<span class="pl-s1">key</span>, <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">0</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/users/is/dbew/pyenvs/timeseries/lib/python2.7/site-packages/pandas-0.13.0_292_g4dcecb0-py2.7-linux-x86_64.egg/pandas/core/indexing.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">744</span>, <span class="pl-s1">in</span> <span class="pl-s1">_getitem_axis</span>
    <span class="pl-k">return</span> <span class="pl-s1">self</span>.<span class="pl-en">_getitem_iterable</span>(<span class="pl-s1">key</span>, <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-s1">axis</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/users/is/dbew/pyenvs/timeseries/lib/python2.7/site-packages/pandas-0.13.0_292_g4dcecb0-py2.7-linux-x86_64.egg/pandas/core/indexing.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">816</span>, <span class="pl-s1">in</span> <span class="pl-s1">_getitem_iterable</span>
    <span class="pl-s1">convert</span><span class="pl-c1">=</span><span class="pl-c1">False</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/users/is/dbew/pyenvs/timeseries/lib/python2.7/site-packages/pandas-0.13.0_292_g4dcecb0-py2.7-linux-x86_64.egg/pandas/core/generic.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">1164</span>, <span class="pl-s1">in</span> <span class="pl-s1">take</span>
    <span class="pl-s1">new_data</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-s1">_data</span>.<span class="pl-en">take</span>(<span class="pl-s1">indices</span>, <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-s1">baxis</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/users/is/dbew/pyenvs/timeseries/lib/python2.7/site-packages/pandas-0.13.0_292_g4dcecb0-py2.7-linux-x86_64.egg/pandas/core/internals.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">3366</span>, <span class="pl-s1">in</span> <span class="pl-s1">take</span>
    <span class="pl-s1">ref_items</span><span class="pl-c1">=</span><span class="pl-s1">new_axes</span>[<span class="pl-c1">0</span>], <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-s1">axis</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/users/is/dbew/pyenvs/timeseries/lib/python2.7/site-packages/pandas-0.13.0_292_g4dcecb0-py2.7-linux-x86_64.egg/pandas/core/internals.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">2337</span>, <span class="pl-s1">in</span> <span class="pl-s1">apply</span>
    <span class="pl-s1">do_integrity_check</span><span class="pl-c1">=</span><span class="pl-s1">do_integrity_check</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/users/is/dbew/pyenvs/timeseries/lib/python2.7/site-packages/pandas-0.13.0_292_g4dcecb0-py2.7-linux-x86_64.egg/pandas/core/internals.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">1990</span>, <span class="pl-s1">in</span> <span class="pl-s1">__init__</span>
    <span class="pl-s1">self</span>.<span class="pl-en">_set_ref_locs</span>(<span class="pl-s1">do_refs</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/users/is/dbew/pyenvs/timeseries/lib/python2.7/site-packages/pandas-0.13.0_292_g4dcecb0-py2.7-linux-x86_64.egg/pandas/core/internals.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">2130</span>, <span class="pl-s1">in</span> <span class="pl-s1">_set_ref_locs</span>
    <span class="pl-s">'have _ref_locs set'</span> <span class="pl-c1">%</span> (<span class="pl-s1">block</span>, <span class="pl-s1">labels</span>))
<span class="pl-v">AssertionError</span>: <span class="pl-v">Cannot</span> <span class="pl-s1">create</span> <span class="pl-v">BlockManager</span>.<span class="pl-s1">_ref_locs</span> <span class="pl-s1">because</span> <span class="pl-s1">block</span> [<span class="pl-v">FloatBlock</span>: [<span class="pl-s1">a</span>], <span class="pl-c1">1</span> <span class="pl-s1">x</span> <span class="pl-c1">3</span>, <span class="pl-s1">dtype</span>: <span class="pl-s1">float64</span>] <span class="pl-s1">with</span> <span class="pl-s1">duplicate</span> <span class="pl-s1">items</span> [<span class="pl-v">Index</span>([<span class="pl-s">u'a'</span>, <span class="pl-s">u'c'</span>, <span class="pl-s">u'a'</span>], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s">'object'</span>)] <span class="pl-s1">does</span> <span class="pl-c1">not</span> <span class="pl-s1">have</span> <span class="pl-s1">_ref_locs</span> <span class="pl-s1">set</span></pre></div>
<p dir="auto">If instead we take a copy of the intermediate step, then it works:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="z = df[['a', 'c', 'a']].copy()
z.ix[['a', 'c', 'a']]
Out[89]: 
    a   c   a
a   0   2   0
c  10  12  10
a   0   2   0

[3 rows x 3 columns]"><pre class="notranslate"><span class="pl-s1">z</span> <span class="pl-c1">=</span> <span class="pl-s1">df</span>[[<span class="pl-s">'a'</span>, <span class="pl-s">'c'</span>, <span class="pl-s">'a'</span>]].<span class="pl-en">copy</span>()
<span class="pl-s1">z</span>.<span class="pl-s1">ix</span>[[<span class="pl-s">'a'</span>, <span class="pl-s">'c'</span>, <span class="pl-s">'a'</span>]]
<span class="pl-v">Out</span>[<span class="pl-c1">89</span>]: 
    <span class="pl-s1">a</span>   <span class="pl-s1">c</span>   <span class="pl-s1">a</span>
<span class="pl-s1">a</span>   <span class="pl-c1">0</span>   <span class="pl-c1">2</span>   <span class="pl-c1">0</span>
<span class="pl-s1">c</span>  <span class="pl-c1">10</span>  <span class="pl-c1">12</span>  <span class="pl-c1">10</span>
<span class="pl-s1">a</span>   <span class="pl-c1">0</span>   <span class="pl-c1">2</span>   <span class="pl-c1">0</span>

[<span class="pl-c1">3</span> <span class="pl-s1">rows</span> <span class="pl-s1">x</span> <span class="pl-c1">3</span> <span class="pl-s1">columns</span>]</pre></div>
<p dir="auto">This means that if you several functions which each do a part of the data processing, you need to know the history of an object to know whether what you're doing works. I think .ix should <em>always</em> succeed on a DataFrame or Series, regardless of how it was constructed.</p>
<p dir="auto">(I've read the discussion at <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="26232487" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6056" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/6056/hovercard" href="https://github.com/pandas-dev/pandas/issues/6056">#6056</a> about chained operations - but it's not something you can avoid if you have a pipeline of small steps instead of one big step).</p>
<p dir="auto">This wasn't an issue in 0.11.0 but is failing in 0.13.0 and the latest master. Here's the output of installed versions when running on the master:</p>
<p dir="auto">commit: None<br>
python: 2.7.3.final.0<br>
python-bits: 64<br>
OS: Linux<br>
OS-release: 2.6.18-308.el5<br>
processor: x86_64<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: en_GB</p>
<p dir="auto">pandas: 0.13.0-292-g4dcecb0<br>
Cython: 0.16<br>
numpy: 1.7.1<br>
scipy: 0.9.0<br>
statsmodels: None<br>
patsy: None<br>
scikits.timeseries: None<br>
dateutil: 1.5<br>
pytz: None<br>
bottleneck: 0.6.0<br>
tables: 2.3.1-1<br>
numexpr: 2.0.1<br>
matplotlib: 1.1.1<br>
openpyxl: None<br>
xlrd: 0.8.0<br>
xlwt: None<br>
xlsxwriter: None<br>
sqlalchemy: None<br>
lxml: 2.3.6<br>
bs4: None<br>
html5lib: None<br>
bq: None<br>
apiclient: None</p>
<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# Your code here
ParserErrorTraceback (most recent call last)
&lt;ipython-input-9-4892e831abe8&gt; in &lt;module&gt;()
      1 import pandas as pd
----&gt; 2 data = pd.read_csv(&quot;https://github.com/vaibhaw1994kumar/MachineLearning-test-cases/blob/master/international-airline-passengers.csv&quot;,usecols=[1],engine='python',skipfooter=3)

/usr/lib64/python2.7/site-packages/pandas/io/parsers.pyc in parser_f(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, escapechar, comment, encoding, dialect, tupleize_cols, error_bad_lines, warn_bad_lines, skipfooter, doublequote, delim_whitespace, low_memory, memory_map, float_precision)
    676                     skip_blank_lines=skip_blank_lines)
    677 
--&gt; 678         return _read(filepath_or_buffer, kwds)
    679 
    680     parser_f.__name__ = name

/usr/lib64/python2.7/site-packages/pandas/io/parsers.pyc in _read(filepath_or_buffer, kwds)
    444 
    445     try:
--&gt; 446         data = parser.read(nrows)
    447     finally:
    448         parser.close()

/usr/lib64/python2.7/site-packages/pandas/io/parsers.pyc in read(self, nrows)
   1034                 raise ValueError('skipfooter not supported for iteration')
   1035 
-&gt; 1036         ret = self._engine.read(nrows)
   1037 
   1038         # May alter columns / col_dict

/usr/lib64/python2.7/site-packages/pandas/io/parsers.pyc in read(self, rows)
   2237     def read(self, rows=None):
   2238         try:
-&gt; 2239             content = self._get_lines(rows)
   2240         except StopIteration:
   2241             if self._first_chunk:

/usr/lib64/python2.7/site-packages/pandas/io/parsers.pyc in _get_lines(self, rows)
   2969                         while True:
   2970                             new_row = self._next_iter_line(
-&gt; 2971                                 row_num=self.pos + rows + 1)
   2972                             rows += 1
   2973 

/usr/lib64/python2.7/site-packages/pandas/io/parsers.pyc in _next_iter_line(self, row_num)
   2715                     msg += '. ' + reason
   2716 
-&gt; 2717                 self._alert_malformed(msg, row_num)
   2718             return None
   2719 

/usr/lib64/python2.7/site-packages/pandas/io/parsers.pyc in _alert_malformed(self, msg, row_num)
   2674 
   2675         if self.error_bad_lines:
-&gt; 2676             raise ParserError(msg)
   2677         elif self.warn_bad_lines:
   2678             base = 'Skipping line {row_num}: '.format(row_num=row_num)

ParserError: new-line character seen in unquoted field - do you need to open the file in universal-newline mode?. Error could possibly be due to parsing errors in the skipped footer rows (the skipfooter keyword is only applied after Python's csv library has parsed all rows).
"><pre class="notranslate"><span class="pl-c"># Your code here</span>
<span class="pl-v">ParserErrorTraceback</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">&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">9</span><span class="pl-c1">-</span><span class="pl-c1">4892e831</span><span class="pl-s1">abe8</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">1</span> <span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</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">2</span> <span class="pl-s1">data</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">read_csv</span>(<span class="pl-s">"https://github.com/vaibhaw1994kumar/MachineLearning-test-cases/blob/master/international-airline-passengers.csv"</span>,<span class="pl-s1">usecols</span><span class="pl-c1">=</span>[<span class="pl-c1">1</span>],<span class="pl-s1">engine</span><span class="pl-c1">=</span><span class="pl-s">'python'</span>,<span class="pl-s1">skipfooter</span><span class="pl-c1">=</span><span class="pl-c1">3</span>)

<span class="pl-c1">/</span><span class="pl-s1">usr</span><span class="pl-c1">/</span><span class="pl-s1">lib64</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-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">io</span><span class="pl-c1">/</span><span class="pl-s1">parsers</span>.<span class="pl-s1">pyc</span> <span class="pl-c1">in</span> <span class="pl-en">parser_f</span>(<span class="pl-s1">filepath_or_buffer</span>, <span class="pl-s1">sep</span>, <span class="pl-s1">delimiter</span>, <span class="pl-s1">header</span>, <span class="pl-s1">names</span>, <span class="pl-s1">index_col</span>, <span class="pl-s1">usecols</span>, <span class="pl-s1">squeeze</span>, <span class="pl-s1">prefix</span>, <span class="pl-s1">mangle_dupe_cols</span>, <span class="pl-s1">dtype</span>, <span class="pl-s1">engine</span>, <span class="pl-s1">converters</span>, <span class="pl-s1">true_values</span>, <span class="pl-s1">false_values</span>, <span class="pl-s1">skipinitialspace</span>, <span class="pl-s1">skiprows</span>, <span class="pl-s1">nrows</span>, <span class="pl-s1">na_values</span>, <span class="pl-s1">keep_default_na</span>, <span class="pl-s1">na_filter</span>, <span class="pl-s1">verbose</span>, <span class="pl-s1">skip_blank_lines</span>, <span class="pl-s1">parse_dates</span>, <span class="pl-s1">infer_datetime_format</span>, <span class="pl-s1">keep_date_col</span>, <span class="pl-s1">date_parser</span>, <span class="pl-s1">dayfirst</span>, <span class="pl-s1">iterator</span>, <span class="pl-s1">chunksize</span>, <span class="pl-s1">compression</span>, <span class="pl-s1">thousands</span>, <span class="pl-s1">decimal</span>, <span class="pl-s1">lineterminator</span>, <span class="pl-s1">quotechar</span>, <span class="pl-s1">quoting</span>, <span class="pl-s1">escapechar</span>, <span class="pl-s1">comment</span>, <span class="pl-s1">encoding</span>, <span class="pl-s1">dialect</span>, <span class="pl-s1">tupleize_cols</span>, <span class="pl-s1">error_bad_lines</span>, <span class="pl-s1">warn_bad_lines</span>, <span class="pl-s1">skipfooter</span>, <span class="pl-s1">doublequote</span>, <span class="pl-s1">delim_whitespace</span>, <span class="pl-s1">low_memory</span>, <span class="pl-s1">memory_map</span>, <span class="pl-s1">float_precision</span>)
    <span class="pl-c1">676</span>                     <span class="pl-s1">skip_blank_lines</span><span class="pl-c1">=</span><span class="pl-s1">skip_blank_lines</span>)
    <span class="pl-c1">677</span> 
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">678</span>         <span class="pl-s1">return</span> <span class="pl-en">_read</span>(<span class="pl-s1">filepath_or_buffer</span>, <span class="pl-s1">kwds</span>)
    <span class="pl-c1">679</span> 
    <span class="pl-c1">680</span>     <span class="pl-s1">parser_f</span>.<span class="pl-s1">__name__</span> <span class="pl-c1">=</span> <span class="pl-s1">name</span>

<span class="pl-c1">/</span><span class="pl-s1">usr</span><span class="pl-c1">/</span><span class="pl-s1">lib64</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-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">io</span><span class="pl-c1">/</span><span class="pl-s1">parsers</span>.<span class="pl-s1">pyc</span> <span class="pl-c1">in</span> <span class="pl-en">_read</span>(<span class="pl-s1">filepath_or_buffer</span>, <span class="pl-s1">kwds</span>)
    <span class="pl-c1">444</span> 
    <span class="pl-c1">445</span>     <span class="pl-k">try</span>:
<span class="pl-c1">-</span><span class="pl-c1">-&gt;</span> <span class="pl-c1">446</span>         <span class="pl-s1">data</span> <span class="pl-c1">=</span> <span class="pl-s1">parser</span>.<span class="pl-en">read</span>(<span class="pl-s1">nrows</span>)
    <span class="pl-c1">447</span>     <span class="pl-k">finally</span>:
    <span class="pl-c1">448</span>         <span class="pl-s1">parser</span>.<span class="pl-en">close</span>()

<span class="pl-c1">/</span><span class="pl-s1">usr</span><span class="pl-c1">/</span><span class="pl-s1">lib64</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-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">io</span><span class="pl-c1">/</span><span class="pl-s1">parsers</span>.<span class="pl-s1">pyc</span> <span class="pl-c1">in</span> <span class="pl-en">read</span>(<span class="pl-s1">self</span>, <span class="pl-s1">nrows</span>)
   <span class="pl-c1">1034</span>                 <span class="pl-k">raise</span> <span class="pl-v">ValueError</span>(<span class="pl-s">'skipfooter not supported for iteration'</span>)
   <span class="pl-c1">1035</span> 
<span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">1036</span>         <span class="pl-s1">ret</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-s1">_engine</span>.<span class="pl-en">read</span>(<span class="pl-s1">nrows</span>)
   <span class="pl-c1">1037</span> 
   <span class="pl-c1">1038</span>         <span class="pl-c"># May alter columns / col_dict</span>

<span class="pl-c1">/</span><span class="pl-s1">usr</span><span class="pl-c1">/</span><span class="pl-s1">lib64</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-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">io</span><span class="pl-c1">/</span><span class="pl-s1">parsers</span>.<span class="pl-s1">pyc</span> <span class="pl-c1">in</span> <span class="pl-en">read</span>(<span class="pl-s1">self</span>, <span class="pl-s1">rows</span>)
   <span class="pl-c1">2237</span>     <span class="pl-k">def</span> <span class="pl-en">read</span>(<span class="pl-s1">self</span>, <span class="pl-s1">rows</span><span class="pl-c1">=</span><span class="pl-c1">None</span>):
   <span class="pl-c1">2238</span>         <span class="pl-k">try</span>:
<span class="pl-c1">-&gt;</span> <span class="pl-c1">2239</span>             <span class="pl-s1">content</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-en">_get_lines</span>(<span class="pl-s1">rows</span>)
   <span class="pl-c1">2240</span>         <span class="pl-k">except</span> <span class="pl-v">StopIteration</span>:
   <span class="pl-c1">2241</span>             <span class="pl-k">if</span> <span class="pl-s1">self</span>.<span class="pl-s1">_first_chunk</span>:

<span class="pl-c1">/</span><span class="pl-s1">usr</span><span class="pl-c1">/</span><span class="pl-s1">lib64</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-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">io</span><span class="pl-c1">/</span><span class="pl-s1">parsers</span>.<span class="pl-s1">pyc</span> <span class="pl-c1">in</span> <span class="pl-en">_get_lines</span>(<span class="pl-s1">self</span>, <span class="pl-s1">rows</span>)
   <span class="pl-c1">2969</span>                         <span class="pl-s1">while</span> <span class="pl-c1">True</span>:
   <span class="pl-c1">2970</span>                             <span class="pl-s1">new_row</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-en">_next_iter_line</span>(
<span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">2971</span>                                 <span class="pl-s1">row_num</span><span class="pl-c1">=</span><span class="pl-s1">self</span>.<span class="pl-s1">pos</span> <span class="pl-c1">+</span> <span class="pl-s1">rows</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span>)
   <span class="pl-c1">2972</span>                             <span class="pl-s1">rows</span> <span class="pl-c1">+=</span> <span class="pl-c1">1</span>
   <span class="pl-c1">2973</span> 

<span class="pl-c1">/</span><span class="pl-s1">usr</span><span class="pl-c1">/</span><span class="pl-s1">lib64</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-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">io</span><span class="pl-c1">/</span><span class="pl-s1">parsers</span>.<span class="pl-s1">pyc</span> <span class="pl-c1">in</span> <span class="pl-en">_next_iter_line</span>(<span class="pl-s1">self</span>, <span class="pl-s1">row_num</span>)
   <span class="pl-c1">2715</span>                     <span class="pl-s1">msg</span> <span class="pl-c1">+=</span> <span class="pl-s">'. '</span> <span class="pl-c1">+</span> <span class="pl-s1">reason</span>
   <span class="pl-c1">2716</span> 
<span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">2717</span>                 <span class="pl-s1">self</span>.<span class="pl-en">_alert_malformed</span>(<span class="pl-s1">msg</span>, <span class="pl-s1">row_num</span>)
   <span class="pl-c1">2718</span>             <span class="pl-k">return</span> <span class="pl-c1">None</span>
   <span class="pl-c1">2719</span> 

<span class="pl-c1">/</span><span class="pl-s1">usr</span><span class="pl-c1">/</span><span class="pl-s1">lib64</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-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">io</span><span class="pl-c1">/</span><span class="pl-s1">parsers</span>.<span class="pl-s1">pyc</span> <span class="pl-c1">in</span> <span class="pl-en">_alert_malformed</span>(<span class="pl-s1">self</span>, <span class="pl-s1">msg</span>, <span class="pl-s1">row_num</span>)
   <span class="pl-c1">2674</span> 
   <span class="pl-c1">2675</span>         <span class="pl-k">if</span> <span class="pl-s1">self</span>.<span class="pl-s1">error_bad_lines</span>:
<span class="pl-c1">-&gt;</span> <span class="pl-c1">2676</span>             <span class="pl-k">raise</span> <span class="pl-v">ParserError</span>(<span class="pl-s1">msg</span>)
   <span class="pl-c1">2677</span>         <span class="pl-s1">elif</span> <span class="pl-s1">self</span>.<span class="pl-s1">warn_bad_lines</span>:
   <span class="pl-c1">2678</span>             <span class="pl-s1">base</span> <span class="pl-c1">=</span> <span class="pl-s">'Skipping line {row_num}: '</span>.<span class="pl-en">format</span>(<span class="pl-s1">row_num</span><span class="pl-c1">=</span><span class="pl-s1">row_num</span>)

<span class="pl-v">ParserError</span>: <span class="pl-s1">new</span><span class="pl-c1">-</span><span class="pl-s1">line</span> <span class="pl-s1">character</span> <span class="pl-s1">seen</span> <span class="pl-c1">in</span> <span class="pl-s1">unquoted</span> <span class="pl-s1">field</span> <span class="pl-c1">-</span> <span class="pl-s1">do</span> <span class="pl-s1">you</span> <span class="pl-s1">need</span> <span class="pl-s1">to</span> <span class="pl-s1">open</span> <span class="pl-s1">the</span> <span class="pl-s1">file</span> <span class="pl-c1">in</span> <span class="pl-s1">universal</span><span class="pl-c1">-</span><span class="pl-s1">newline</span> <span class="pl-s1">mode</span>?. <span class="pl-v">Error</span> <span class="pl-s1">could</span> <span class="pl-s1">possibly</span> <span class="pl-s1">be</span> <span class="pl-s1">due</span> <span class="pl-s1">to</span> <span class="pl-s1">parsing</span> <span class="pl-s1">errors</span> <span class="pl-c1">in</span> <span class="pl-s1">the</span> <span class="pl-s1">skipped</span> <span class="pl-s1">footer</span> <span class="pl-en">rows</span> (<span class="pl-s1">the</span> <span class="pl-s1">skipfooter</span> <span class="pl-s1">keyword</span> <span class="pl-c1">is</span> <span class="pl-s1">only</span> <span class="pl-s1">applied</span> <span class="pl-s1">after</span> <span class="pl-v">Python</span>'<span class="pl-s1">s</span> <span class="pl-s1">csv</span> <span class="pl-s1">library</span> <span class="pl-s1">has</span> <span class="pl-s1">parsed</span> <span class="pl-s1">all</span> <span class="pl-s1">rows</span>).</pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">[this should explain <strong>why</strong> the current behaviour is a problem and why the expected output is a better solution.]</p>
<p dir="auto"><strong>Note</strong>: We receive a lot of issues on our GitHub tracker, so it is very possible that your issue has been posted before. Please check first before submitting so that we do not have to handle and close duplicates!</p>
<p dir="auto"><strong>Note</strong>: Many problems can be resolved by simply upgrading <code class="notranslate">pandas</code> to the latest version. Before submitting, please check if that solution works for you. If possible, you may want to check if <code class="notranslate">master</code> addresses this issue, but that is not necessary.</p>
<p dir="auto">For documentation-related issues, you can check the latest versions of the docs on <code class="notranslate">master</code> here:</p>
<p dir="auto"><a href="https://pandas-docs.github.io/pandas-docs-travis/" rel="nofollow">https://pandas-docs.github.io/pandas-docs-travis/</a></p>
<p dir="auto">If the issue has not been resolved there, go ahead and file it in the issue tracker.</p>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">data should be uploaded</p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<p dir="auto">[paste the output of <code class="notranslate">pd.show_versions()</code> here below this line]</p>
</details>