Issue 1:
Code Sample, a copy-pastable example if possible

>>> df = pd.DataFrame([[True, True, True]], columns=['key', 'a', 'a'])
>>> df.groupby('key').any()

ValueError: Buffer has wrong number of dimensions (expected 1, got 2)

Problem description

This throws because of the below line:

pandas/pandas/core/groupby/groupby.py

Line 2024
in
0801b8c

mask = isnull(obj.values).view(np.uint8)

Cython is expecting a one dimensional array of masks, but self._iterate_slices() which contains the above statement will provide a multi-dimensional array. Therefore, when the Cython function gets called with mask it is a multi-dimensional object and causes the ValueError.

I'm not sure if this is the expected behavior of self._iterate_slices() or not. If so, there may be implications in other parts of the module.

Output of pd.show_versions()

INSTALLED VERSIONS

commit: 0801b8c

python: 3.6.4.final.0

python-bits: 64

OS: Darwin

OS-release: 17.6.0

machine: x86_64

processor: i386

byteorder: little

LC_ALL: None

LANG: en_US.UTF-8

LOCALE: en_US.UTF-8

pandas: 0.24.0.dev0+184.g0801b8c90

pytest: 3.4.1

pip: 10.0.1

setuptools: 38.5.1

Cython: 0.27.3

numpy: 1.14.1

scipy: 1.0.0

pyarrow: 0.8.0

xarray: 0.10.0

IPython: 6.2.1

sphinx: 1.7.0

patsy: 0.5.0

dateutil: 2.6.1

pytz: 2018.3

blosc: None

bottleneck: 1.2.1

tables: 3.4.2

numexpr: 2.6.4

feather: 0.4.0

matplotlib: 2.1.2

openpyxl: 2.5.0

xlrd: 1.1.0

xlwt: 1.3.0

xlsxwriter: 1.0.2

lxml: 4.1.1

bs4: 4.6.0

html5lib: 1.0.1

sqlalchemy: 1.2.5

pymysql: 0.8.0

psycopg2: 2.7.4 (dt dec pq3 ext lo64)

jinja2: 2.10

s3fs: 0.1.3

fastparquet: 0.1.4

pandas_gbq: 0.4.1

pandas_datareader: None

gcsfs: None

Issue 2:
# 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

I have some weird issue in a DataFrame I'm creating from a row-based array.

Using python3 and pandas 0.17.1 (from debian unstable), I get:

df = pandas.DataFrame(data=data[1:], columns=data[0])
df.iat[0, 0]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
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

Interestingly, I can otherwise manage the dataframe just fine.

The same code, running under python2.7 shows no issue.

What could be the cause of such error?