-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
deepcopy failure on empty dataframes with non-empty column set (numpy 1.12 compatibility) #15370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
not shocked this doesn't work, see #8571 we are not using an override (which we should be), to simply call our custom methods. e.g. basically
if you'd like to take a crack at this issue (and add this as a test) would be appreciated! |
Not sure I know how best to fix it, as I haven't mucked around the internals of dataframes much. It's not obvious to me that this should be fixed in dataframe, ndframe, or somewhere else? |
@bmcfee simply need to define |
closes pandas-dev#15370 Author: Brian McFee <[email protected]> Author: Jeff Reback <[email protected]> Closes pandas-dev#15444 from bmcfee/deepcopy-ndframe and squashes the following commits: bf36f35 [Jeff Reback] TST: skip the panel4d deepcopy tests d58b1f6 [Brian McFee] added tests for copy and deepcopy 35f3e0f [Brian McFee] relocated Index.__deepcopy__ to live near __copy__ 1aea940 [Brian McFee] switched deepcopy test to using generic comparator 7e67e7d [Brian McFee] ndframe and index __copy__ are now proper methods 820664c [Brian McFee] moved deepcopy test to generic.py 9721041 [Brian McFee] added copy/deepcopy to ndframe, fixes pandas-dev#15370
Code Sample, a copy-pastable example if possible
Problem description
This only occurs with numpy 1.12 (and, presumably above): when deepcopying an empty dataframe with a non-empty column set, it fails with the following:
If the column set is also empty, everything works as expected.
On older numpy versions (1.11), it also works as expected.
Expected Output
Not failing.
Output of
pd.show_versions()
pandas: 0.19.2
nose: 1.3.7
pip: 9.0.1
setuptools: 32.3.1.post20170108
Cython: 0.25.2
numpy: 1.12.0
scipy: 0.18.1
statsmodels: None
xarray: None
IPython: 5.1.0
sphinx: None
patsy: None
dateutil: 2.6.0
pytz: 2016.10
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 2.0.0
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
boto: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: