-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
pandas.io.json.dumps raises OverflowError on float32 and float16 NaNs #16686
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
If you want to do a PR for this would be great. Note this is actually tricky to hit in practice as an array of float (whether float 32/64 with nans) is serialized in a slightly different impl. Further we have very limited support for float16s. |
I can try, should I be looking in |
I saw in
Are you suggesting that this code be changed to print the null instead? Or that a different code path be taken and we don't reach here? |
Let me know if this is the right approach, it fixes float32 and I don't care about float16: |
@Kiv - that looks reasonable, although I'm not sure why float 32 isn't already hitting this path that float 64 does? (I'm not especially familiar with this code) |
@chris-b1 if you look at the line before there is a casting to |
Code Sample, a copy-pastable example if possible
Problem description
Float64 does the sensible thing. Float32 and float16 should behave consistently but they error out instead.
Expected Output
'null' for all 3 cases
Output of
pd.show_versions()
pandas: 0.20.2
pytest: None
pip: 9.0.1
setuptools: 27.2.0
Cython: None
numpy: 1.13.0
scipy: 0.19.0
xarray: None
IPython: 5.3.0
sphinx: 1.5.3
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2017.2
blosc: None
bottleneck: None
tables: 3.3.0
numexpr: 2.6.2
feather: None
matplotlib: 2.0.2
openpyxl: None
xlrd: 1.0.0
xlwt: 1.2.0
xlsxwriter: None
lxml: None
bs4: 4.6.0
html5lib: 0.999
sqlalchemy: 1.1.9
pymysql: None
psycopg2: 2.7.1 (dt dec pq3 ext lo64)
jinja2: 2.9.6
s3fs: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: