Numpy NaN handling
See original GitHub issueCurrently when a [Float]
type resolves to np.array([1, np.nan])
the generated payload is [1, NaN]
which is not json-compilant (rather than null
) without any warning. A custom scalar can do the job however as numpy is so widely used, maybe this should be supported out of the box?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:7 (2 by maintainers)
Top Results From Across the Web
numpy.nan_to_num — NumPy v1.24 Manual
Replace NaN with zero and infinity with large finite numbers (default behaviour) or with the numbers defined by the user using the nan...
Read more >How to deal with nan values in numpy - python
Convert your nan values into zero like this one: data = data.replace(np.nan,0).
Read more >Understanding NaN in Numpy and Pandas
NaN is short for Not a number. It is used to represent entries that are undefined. It is also used for representing missing...
Read more >Working of NumPy NaN in Python with Examples
In Python, NumPy NAN stands for not a number and is defined as a substitute for declaring value which are numerical values that...
Read more >How To Handle nan In Numpy
Numpy calculate mean with nanvalues ... Lets check the mean first. ... We got nan which is not correct. We need to exclude...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Still an issue
This is an issue AFAIK for all special float values (not really numpy specific)
nan
,inf
,-inf
. It’s really a pain that json lack a standard way of serializing floats… 😕