Code Sample, a copy-pastable example if possible

#deadlock.py
import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.rand(4,2))
c = []
c.append(c)
c.append(c)
print(df[c])


Problem description

The example above hangs in some C-level function. A quick inspection with perf shows that it is PyArray_DTypeFromObjectHelper.

I came across this when debugging a typo (a list was appending itself instead of the element I was interested in).

Expected Output

Some sort of exception.

Output of pd.show_versions()

This is the environment I get when typing conda create -p /tmp/pd pandas numpy=1.13 on linux64.

INSTALLED VERSIONS ------------------ commit: None python: 3.6.1.final.0 python-bits: 64 OS: Linux OS-release: 4.8.0-51-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 pandas: 0.20.2 pytest: None pip: 9.0.1 setuptools: 27.2.0 Cython: None numpy: 1.12.1 scipy: None xarray: None IPython: None sphinx: None patsy: None dateutil: 2.6.0 pytz: 2017.2 blosc: None bottleneck: None tables: None numexpr: None feather: None matplotlib: None openpyxl: None xlrd: None xlwt: None xlsxwriter: None lxml: None bs4: None html5lib: None sqlalchemy: None pymysql: None psycopg2: None jinja2: None s3fs: None pandas_gbq: None pandas_datareader: None

Comment From: jorisvandenbossche

@Zaharid I suppose this can be closed as it is tracked on the numpy side?

Comment From: Zaharid

Yes. Please do.

On 27 Jun 2017 14:25, "Joris Van den Bossche" notifications@github.com wrote:

@Zaharid https://github.com/zaharid I suppose this can be closed as it is tracked on the numpy side?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pandas-dev/pandas/issues/16778#issuecomment-311342303, or mute the thread https://github.com/notifications/unsubscribe-auth/AFabUgw6FK-myEXYzMvrWvR2fspRgHV-ks5sIPSwgaJpZM4OGX28 .

Comment From: jorisvandenbossche

But thanks for reporting!