Closed
Description
Applying a numpy function, such as np.round
, to a DataFrame with duplicated column indicies can cause an unrecoverable stack overflow error (Fatal Python error: Cannot recover from stack overflow.), which causes e.g. a ipython kernel to crash. E.g. take the following example, where python crashes at line 4:
x = pd.DataFrame(np.random.randn(3,3))
y = pd.DataFrame(np.random.randn(3,3))
z = pd.concat((x, y), axis=1)
print(np.round(z))
However, removing the duplicate column entries, works as expected:
...
z = pd.concat((x, y), axis=1, ignore_index=True)
print(np.round(z))
python 3.5.0, numpy 1.10.1, pandas 0.17.0