Skip to content
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

DataFrame construction breaks python on numpy empty_like #14082

Closed
asishm opened this issue Aug 24, 2016 · 1 comment
Closed

DataFrame construction breaks python on numpy empty_like #14082

asishm opened this issue Aug 24, 2016 · 1 comment
Labels
Bug Duplicate Report Duplicate issue or pull request Reshaping Concat, Merge/Join, Stack/Unstack, Explode

Comments

@asishm
Copy link
Contributor

asishm commented Aug 24, 2016

Code Sample, a copy-pastable example if possible

http://stackoverflow.com/questions/39129419/why-does-dataframe-construction-break-python-on-numpy-empty-like

import numpy as np
import pandas as pd

a = np.array([None, None], dtype=object)
print(a)      # [None None]

dfa = pd.DataFrame(a)
print(dfa)

#      0
#0  None
#1  None

b = np.empty_like(a)
print(b)

#[None None]

(a == b).all()

#True

dfb = pd.DataFrame(b)  # Fine so far
print(dfb.values)

#[[None]
 #[None]]

print(dfb)  #Crash

Expected Output

output of pd.show_versions()

INSTALLED VERSIONS
------------------
commit: None
python: 3.5.1.final.0
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 61 Stepping 4, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None

pandas: 0.18.1
nose: None
pip: 8.1.2
setuptools: 18.2
Cython: None
numpy: 1.11.1
scipy: 0.17.1
statsmodels: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.5.3
pytz: 2016.4
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.5.1
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: 4.5.0
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
pandas_datareader: None
@jreback
Copy link
Contributor

jreback commented Aug 24, 2016

duplicate of #13717 and fixed by #13764 in master / not-yet-released 0.19.0

@jreback jreback closed this as completed Aug 24, 2016
@jreback jreback added Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode Duplicate Report Duplicate issue or pull request labels Aug 24, 2016
@jreback jreback added this to the No action milestone Aug 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Duplicate Report Duplicate issue or pull request Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

No branches or pull requests

2 participants