Segfault when json serializing a 0d numpy.array · Issue #9576 · pandas-dev/pandas (original) (raw)

@gpoulin

Pandas json serializer Segfault when trying to serialize a 0d numpy.array. Ideally, it should able to serialize this structure as a scalar or at least raise a TypeError.

import numpy as np import pandas as pd

pd.json.dumps(np.array(1)) # Segfault pd.Series([np.array(x) for x in range(5)]).to_json() # Segfault

pandas version
(also tested with python2.7/pandas0.15.2/gentoo and python3.3/pandas0.15.2/gentoo and python3.4/pandas0.15.2/Ubuntu/anaconda)

INSTALLED VERSIONS
------------------
commit: None
python: 3.4.2.final.0
python-bits: 64
OS: Linux
OS-release: 3.19.0-gentoo
machine: x86_64
processor: Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz
byteorder: little
LC_ALL: None
LANG: fr_CA.utf8

pandas: 0.15.2
nose: 1.3.4
Cython: 0.22
numpy: 1.9.1
scipy: 0.15.0
statsmodels: 0.6.1
IPython: 2.4.0
sphinx: 1.2.3
patsy: 0.3.0
dateutil: 2.4.0
pytz: 2014.10
bottleneck: 0.8.0
tables: 3.1.1
numexpr: 2.4
matplotlib: 1.4.3
openpyxl: 2.1.0
xlrd: 0.9.3
xlwt: None
xlsxwriter: 0.5.6
lxml: 3.4.2
bs4: 4.3.2
html5lib: 0.999
httplib2: None
apiclient: None
rpy2: 2.5.6
sqlalchemy: 0.9.8
pymysql: 0.6.3.None
psycopg2: 2.6 (dt dec pq3 ext lo64)