<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="&gt;&gt;&gt; df = pd.DataFrame([[True, True, True]], columns=['key', 'a', 'a'])
&gt;&gt;&gt; df.groupby('key').any()

ValueError: Buffer has wrong number of dimensions (expected 1, got 2)"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <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-c1">True</span>, <span class="pl-c1">True</span>, <span class="pl-c1">True</span>]], <span class="pl-s1">columns</span><span class="pl-c1">=</span>[<span class="pl-s">'key'</span>, <span class="pl-s">'a'</span>, <span class="pl-s">'a'</span>])
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">df</span>.<span class="pl-en">groupby</span>(<span class="pl-s">'key'</span>).<span class="pl-en">any</span>()

<span class="pl-v">ValueError</span>: <span class="pl-v">Buffer</span> <span class="pl-s1">has</span> <span class="pl-s1">wrong</span> <span class="pl-s1">number</span> <span class="pl-s1">of</span> <span class="pl-en">dimensions</span> (<span class="pl-s1">expected</span> <span class="pl-c1">1</span>, <span class="pl-s1">got</span> <span class="pl-c1">2</span>)</pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">This throws because of the below line:</p>
<p dir="auto"></p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/pandas-dev/pandas/blob/0801b8c9090752c1342962aecd03e9a0468adbd4/pandas/core/groupby/groupby.py#L2024">pandas/pandas/core/groupby/groupby.py</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 2024
      in
      <a data-pjax="true" class="commit-tease-sha" href="/pandas-dev/pandas/commit/0801b8c9090752c1342962aecd03e9a0468adbd4">0801b8c</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L2024" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2024"></td>
          <td id="LC2024" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">mask</span> <span class="pl-c1">=</span> <span class="pl-en">isnull</span>(<span class="pl-s1">obj</span>.<span class="pl-s1">values</span>).<span class="pl-en">view</span>(<span class="pl-s1">np</span>.<span class="pl-s1">uint8</span>) </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<p dir="auto">Cython is expecting a one dimensional array of masks, but <code class="notranslate">self._iterate_slices()</code> which contains the above statement will provide a multi-dimensional array. Therefore, when the Cython function gets called with <code class="notranslate">mask</code> it is a multi-dimensional object and causes the <code class="notranslate">ValueError</code>.</p>
<p dir="auto">I'm not sure if this is the expected behavior of <code class="notranslate">self._iterate_slices()</code> or not. If so, there may be implications in other parts of the module.</p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/pandas-dev/pandas/commit/0801b8c9090752c1342962aecd03e9a0468adbd4/hovercard" href="https://github.com/pandas-dev/pandas/commit/0801b8c9090752c1342962aecd03e9a0468adbd4"><tt>0801b8c</tt></a><br>
python: 3.6.4.final.0<br>
python-bits: 64<br>
OS: Darwin<br>
OS-release: 17.6.0<br>
machine: x86_64<br>
processor: i386<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: en_US.UTF-8<br>
LOCALE: en_US.UTF-8</p>
<p dir="auto">pandas: 0.24.0.dev0+184.g0801b8c90<br>
pytest: 3.4.1<br>
pip: 10.0.1<br>
setuptools: 38.5.1<br>
Cython: 0.27.3<br>
numpy: 1.14.1<br>
scipy: 1.0.0<br>
pyarrow: 0.8.0<br>
xarray: 0.10.0<br>
IPython: 6.2.1<br>
sphinx: 1.7.0<br>
patsy: 0.5.0<br>
dateutil: 2.6.1<br>
pytz: 2018.3<br>
blosc: None<br>
bottleneck: 1.2.1<br>
tables: 3.4.2<br>
numexpr: 2.6.4<br>
feather: 0.4.0<br>
matplotlib: 2.1.2<br>
openpyxl: 2.5.0<br>
xlrd: 1.1.0<br>
xlwt: 1.3.0<br>
xlsxwriter: 1.0.2<br>
lxml: 4.1.1<br>
bs4: 4.6.0<br>
html5lib: 1.0.1<br>
sqlalchemy: 1.2.5<br>
pymysql: 0.8.0<br>
psycopg2: 2.7.4 (dt dec pq3 ext lo64)<br>
jinja2: 2.10<br>
s3fs: 0.1.3<br>
fastparquet: 0.1.4<br>
pandas_gbq: 0.4.1<br>
pandas_datareader: None<br>
gcsfs: None</p>
</details>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# error
In [27]: pd.DataFrame([[1, 1]], columns=['x','x']).iat[0,0]
TypeError: len() of unsized object

# ok
In [26]: pd.DataFrame([[1, 1]], columns=['x','y']).iat[0,0]
Out[26]: 1"><pre class="notranslate"><code class="notranslate"># error
In [27]: pd.DataFrame([[1, 1]], columns=['x','x']).iat[0,0]
TypeError: len() of unsized object

# ok
In [26]: pd.DataFrame([[1, 1]], columns=['x','y']).iat[0,0]
Out[26]: 1
</code></pre></div>
<p dir="auto">I have some weird issue in a DataFrame I'm creating from a row-based array.<br>
Using python3 and pandas 0.17.1 (from debian unstable), I get:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="df = pandas.DataFrame(data=data[1:], columns=data[0])
df.iat[0, 0]
Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;/usr/lib/python3/dist-packages/pandas/core/indexing.py&quot;, line 1555, in __getitem__
    return self.obj.get_value(*key, takeable=self._takeable)
  File &quot;/usr/lib/python3/dist-packages/pandas/core/frame.py&quot;, line 1808, in get_value
    series = self._iget_item_cache(col)
  File &quot;/usr/lib/python3/dist-packages/pandas/core/generic.py&quot;, line 1116, in _iget_item_cache
    lower = self.take(item, axis=self._info_axis_number, convert=True)
  File &quot;/usr/lib/python3/dist-packages/pandas/core/generic.py&quot;, line 1371, in take
    convert=True, verify=True)
  File &quot;/usr/lib/python3/dist-packages/pandas/core/internals.py&quot;, line 3628, in take
    axis=axis, allow_dups=True)
  File &quot;/usr/lib/python3/dist-packages/pandas/core/internals.py&quot;, line 3510, in reindex_indexer
    indexer, fill_tuple=(fill_value,))
  File &quot;/usr/lib/python3/dist-packages/pandas/core/internals.py&quot;, line 3536, in _slice_take_blocks_ax0
    slice_or_indexer, self.shape[0], allow_fill=allow_fill)
  File &quot;/usr/lib/python3/dist-packages/pandas/core/internals.py&quot;, line 4865, in _preprocess_slice_or_indexer
    return 'fancy', indexer, len(indexer)
TypeError: len() of unsized object"><pre class="notranslate"><code class="notranslate">df = pandas.DataFrame(data=data[1:], columns=data[0])
df.iat[0, 0]
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "/usr/lib/python3/dist-packages/pandas/core/indexing.py", line 1555, in __getitem__
    return self.obj.get_value(*key, takeable=self._takeable)
  File "/usr/lib/python3/dist-packages/pandas/core/frame.py", line 1808, in get_value
    series = self._iget_item_cache(col)
  File "/usr/lib/python3/dist-packages/pandas/core/generic.py", line 1116, in _iget_item_cache
    lower = self.take(item, axis=self._info_axis_number, convert=True)
  File "/usr/lib/python3/dist-packages/pandas/core/generic.py", line 1371, in take
    convert=True, verify=True)
  File "/usr/lib/python3/dist-packages/pandas/core/internals.py", line 3628, in take
    axis=axis, allow_dups=True)
  File "/usr/lib/python3/dist-packages/pandas/core/internals.py", line 3510, in reindex_indexer
    indexer, fill_tuple=(fill_value,))
  File "/usr/lib/python3/dist-packages/pandas/core/internals.py", line 3536, in _slice_take_blocks_ax0
    slice_or_indexer, self.shape[0], allow_fill=allow_fill)
  File "/usr/lib/python3/dist-packages/pandas/core/internals.py", line 4865, in _preprocess_slice_or_indexer
    return 'fancy', indexer, len(indexer)
TypeError: len() of unsized object
</code></pre></div>
<p dir="auto">Interestingly, I can otherwise manage the dataframe just fine.<br>
The same code, running under python2.7 shows no issue.</p>
<p dir="auto">What could be the cause of such error?</p>