question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Numpy NaN handling

See original GitHub issue

Currently 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:open
  • Created 5 years ago
  • Reactions:7
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
zifeocommented, Apr 10, 2020

Still an issue

0reactions
olejorgenbcommented, May 28, 2020

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… 😕

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found