8000 ERR: fail fast with non-supported dtypes on construction · Issue #14349 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content
ERR: fail fast with non-supported dtypes on construction #14349
@jzwinck

Description

@jzwinck

Example Code

print 666A (pd.DataFrame({'a': np.zeros(1000, 'V4')}))

Results

Non-deterministic behavior. Sometimes you get all zeros, sometimes you get garbage like this:

                        a
0            [1, 0, 0, 0]
1            [0, 0, 0, 0]
2            [8, 0, 0, 0]
3            [0, 0, 0, 0]
4      [48, -92, 71, -60]
5        [-27, 127, 0, 0]
6            [5, 0, 0, 0]
7            [0, 0, 0, 0]
...

That is despite the fact that the bytes are actually all zero, and NumPy prints all rows as [0, 0, 0, 0].

Sometimes when printing a wider DataFrame containing such a column, it segfaults with this stack trace:

#0  BYTE_copyswap (dst=0x7fffebdbe868, src=0x7fffe9f0d054, __NPY_UNUSED_TAGGEDswap=0, __NPY_UNUSED_TAGGEDarr=0x7fffea15f990)
    at numpy/core/src/multiarray/arraytypes.c.src:1911
#1  0x00007ffff5d82075 in PyArray_Scalar (data=0x7fffe9f0d054, descr=0x7fffea1612d0, base=<optimized out>) at numpy/core/src/multiarray/scalarapi.c:835
#2  0x00007ffff5d52df0 in array_item (self=0x7fffea15f990, i=<optimized out>) at numpy/core/src/multiarray/mapping.c:1371

Expected Output

All rows [0, 0, 0, 0] - just as NumPy prints it.

Output of pd.show_versions()

## INSTALLED VERSIONS

commit: None
python: 3.5.1
python-bits: 64
OS: Linux
OS-release: 3.13.0
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8

pandas: 0.18.1
pip: 8.1.2
setuptools: 27.2.0
numpy: 1.11.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Dtype ConversionsUnexpected or buggy dtype conversionsError ReportingIncorrect or improved errors from pandas

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0