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.

ValueError: Out of range float values are not JSON compliant

See original GitHub issue

Hello, 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:closed
  • Created 7 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
bryevdvcommented, Nov 3, 2016

@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.

1reaction
Evgeny7777commented, Nov 4, 2016

Most probably it was NaN in data indeed, worked after clean up. Thanks

Read more comments on GitHub >

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

github_iconTop Related Medium Post

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