ValueError: Out of range float values are not JSON compliant
See original GitHub issueHello, i’m getting and error with show(p, notebook_handle=True)
, with show(p)
it’s ok, using 0.12.3
May provide more details if necessary, error is below
-----------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-180-18380363c66d> in <module>()
----> 1 show(p, notebook_handle=True)
2 # show(p)
/home/vagrant/anaconda3/lib/python3.5/site-packages/bokeh/io.py in show(obj, browser, new, notebook_handle)
312 if obj not in _state.document.roots:
313 _state.document.add_root(obj)
--> 314 return _show_with_state(obj, _state, browser, new, notebook_handle=notebook_handle)
315
316
/home/vagrant/anaconda3/lib/python3.5/site-packages/bokeh/io.py in _show_with_state(obj, state, browser, new, notebook_handle)
322
323 if state.notebook:
--> 324 comms_handle = _show_notebook_with_state(obj, state, notebook_handle)
325 shown = True
326
/home/vagrant/anaconda3/lib/python3.5/site-packages/bokeh/io.py in _show_notebook_with_state(obj, state, notebook_handle)
348 if comms_target:
349 handle = _CommsHandle(get_comms(comms_target), state.document,
--> 350 state.document.to_json())
351 state.last_comms_handle = handle
352 return handle
/home/vagrant/anaconda3/lib/python3.5/site-packages/bokeh/document.py in to_json(self)
825 # this is a total hack to go via a string, needed because
826 # our BokehJSONEncoder goes straight to a string.
--> 827 doc_json = self.to_json_string()
828 return loads(doc_json)
829
/home/vagrant/anaconda3/lib/python3.5/site-packages/bokeh/document.py in to_json_string(self, indent)
818 }
819
--> 820 return serialize_json(json, indent=indent)
821
822 def to_json(self):
/home/vagrant/anaconda3/lib/python3.5/site-packages/bokeh/core/json_encoder.py in serialize_json(obj, encoder, indent, **kwargs)
97 indent = 2
98
---> 99 return json.dumps(obj, cls=encoder, allow_nan=False, indent=indent, separators=separators, sort_keys=True, **kwargs)
/home/vagrant/anaconda3/lib/python3.5/json/__init__.py in dumps(obj, skipkeys, ensure_ascii, check_circular, allow_nan, cls, indent, separators, default, sort_keys, **kw)
235 check_circular=check_circular, allow_nan=allow_nan, indent=indent,
236 separators=separators, default=default, sort_keys=sort_keys,
--> 237 **kw).encode(obj)
238
239
/home/vagrant/anaconda3/lib/python3.5/json/encoder.py in encode(self, o)
196 # exceptions aren't as detailed. The list call should be roughly
197 # equivalent to the PySequence_Fast that ''.join() would do.
--> 198 chunks = self.iterencode(o, _one_shot=True)
199 if not isinstance(chunks, (list, tuple)):
200 chunks = list(chunks)
/home/vagrant/anaconda3/lib/python3.5/json/encoder.py in iterencode(self, o, _one_shot)
254 self.key_separator, self.item_separator, self.sort_keys,
255 self.skipkeys, _one_shot)
--> 256 return _iterencode(o, 0)
257
258 def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
ValueError: Out of range float values are not JSON compliant
Issue Analytics
- State:
- Created 7 years ago
- Comments:17 (8 by maintainers)
Top Results From Across the Web
Bokeh: ValueError: Out of range float values are not JSON ...
ValueError : Out of range float values are not JSON compliant. if i change the first value of the list (myList[0]) to float...
Read more >Out of range float values are not JSON compliant
When i see this error, i found the cause of problem. If i use pandas and field value is NaN, that makes problem....
Read more >Out of range float values are not JSON compliant: nan - Reddit
I'm working with a pretty massive dataset of real estate transactions and I'm trying to make it all fit into a nice little...
Read more >ValueError: Out of range float values are not JSON compliant ...
The above is showing me an output within the notebook, but still throws : ValueError: Out of range float values are not JSON...
Read more >Out of range float values are not JSON compliant with django ...
... File "D:\python3\lib\json\encoder.py", line 257, in iterencode return _iterencode(o, 0) ValueError: Out of range float values are not JSON compliant.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
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
@Evgeny7777 there is no chance to be able to help diagnose a problem like this without much more information (OS, 32/64 bit, locale settings, etc.), as well as a complete code sample to reproduce it.
Most probably it was NaN in data indeed, worked after clean up. Thanks