-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
Dtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsError ReportingIncorrect or improved errors from pandasIncorrect or improved errors from pandas
Description
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
Labels
Dtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsError ReportingIncorrect or improved errors from pandasIncorrect or improved errors from pandas