{"action":"created","issue":{"url":"https://api.github.com/repos/bokeh/bokeh/issues/735","repository_url":"https://api.github.com/repos/bokeh/bokeh","labels_url":"https://api.github.com/repos/bokeh/bokeh/issues/735/labels{/name}","comments_url":"https://api.github.com/repos/bokeh/bokeh/issues/735/comments","events_url":"https://api.github.com/repos/bokeh/bokeh/issues/735/events","html_url":"https://github.com/bokeh/bokeh/issues/735","id":36215338,"number":735,"title":"Inconsistent conversion of np.nan to JSON data in bokehjs","user":{"login":"yhey","id":7947745,"avatar_url":"https://avatars.githubusercontent.com/u/7947745?v=3","gravatar_id":"","url":"https://api.github.com/users/yhey","html_url":"https://github.com/yhey","followers_url":"https://api.github.com/users/yhey/followers","following_url":"https://api.github.com/users/yhey/following{/other_user}","gists_url":"https://api.github.com/users/yhey/gists{/gist_id}","starred_url":"https://api.github.com/users/yhey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yhey/subscriptions","organizations_url":"https://api.github.com/users/yhey/orgs","repos_url":"https://api.github.com/users/yhey/repos","events_url":"https://api.github.com/users/yhey/events{/privacy}","received_events_url":"https://api.github.com/users/yhey/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bokeh/bokeh/labels/reso:%20completed","name":"reso: completed","color":"345065"},{"url":"https://api.github.com/repos/bokeh/bokeh/labels/type:%20bug","name":"type: bug","color":"C02942"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/bokeh/bokeh/milestones/19","html_url":"https://github.com/bokeh/bokeh/milestones/0.9.2","labels_url":"https://api.github.com/repos/bokeh/bokeh/milestones/19/labels","id":1193622,"number":19,"title":"0.9.2","description":"","creator":{"login":"bryevdv","id":1078448,"avatar_url":"https://avatars.githubusercontent.com/u/1078448?v=3","gravatar_id":"","url":"https://api.github.com/users/bryevdv","html_url":"https://github.com/bryevdv","followers_url":"https://api.github.com/users/bryevdv/followers","following_url":"https://api.github.com/users/bryevdv/following{/other_user}","gists_url":"https://api.github.com/users/bryevdv/gists{/gist_id}","starred_url":"https://api.github.com/users/bryevdv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryevdv/subscriptions","organizations_url":"https://api.github.com/users/bryevdv/orgs","repos_url":"https://api.github.com/users/bryevdv/repos","events_url":"https://api.github.com/users/bryevdv/events{/privacy}","received_events_url":"https://api.github.com/users/bryevdv/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":102,"state":"closed","created_at":"2015-07-05T13:30:06Z","updated_at":"2016-04-25T09:44:02Z","due_on":null,"closed_at":"2015-07-24T13:46:14Z"},"comments":3,"created_at":"2014-06-21T02:50:43Z","updated_at":"2016-07-07T18:06:12Z","closed_at":"2015-07-08T02:52:13Z","body":"When plotting from DataSource with output_file, depending on whether the list-like is numpy.ndarray and other conditions, a numpy.nan is converted sometimes to \"NaN\" (with quotes) and sometimes to just NaN (without quotes) in the JSON data structure in the resulting html page.\r\n\r\nFor example:\r\n<pre>\r\nfrom bokeh.plotting import *\r\nimport numpy as np\r\nsource = ColumnDataSource()\r\nx = list(range(0, 6))\r\nsource.add(name=\"x\", data=x)\r\ny = list()\r\ny.append([np.nan]*6)\r\ny.append([None]*3 + [np.nan]*3)\r\ny.append([np.nan]*3 + [None]*3)\r\ny.append([1.0]*3 + [np.nan]*3)\r\ny.append([np.nan]*3 + [1.0]*3)\r\ny.append([None]*2 + [np.nan]*2 + [None]*2)\r\ny.append([np.nan]*2 + [None]*2 + [np.nan]*2)\r\ny.append([1.0]*2 + [np.nan]*2 + [1.0]*2)\r\ny.append([np.nan]*2 + [1.0]*2 + [np.nan]*2)\r\nfor idx,yi in enumerate(y):\r\n    source.add(name=\"y%d\"%idx, data=yi)\r\n    source.add(name=\"yr%d\"%idx, data=np.array(yi))\r\noutput_file(\"test.html\")\r\nhold(True)\r\nfor idx in range(0, len(y)):\r\n    scatter(\"x\", \"y%d\"%idx, source=source)\r\n    scatter(\"x\", \"yr%d\"%idx, source=source)\r\nshow()\r\n</pre>\r\nIn the resulting html, some of the np.nan are converted to \"NaN\" while others to NaN.\r\n\r\nThis difference does not affect the displayed plot in any apparent way (in either case, the associated glyphs are not drawn). However, NaN is not a valid JSON value and an attempt to extract the JSON data structure from the html to be parsed in external tool would fail. It would be nice if np.nan is consistently converted to \"NaN\" in JSON when output_file() is used.\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/bokeh/bokeh/issues/comments/231159962","html_url":"https://github.com/bokeh/bokeh/issues/735#issuecomment-231159962","issue_url":"https://api.github.com/repos/bokeh/bokeh/issues/735","id":231159962,"user":{"login":"artifex85","id":18556988,"avatar_url":"https://avatars.githubusercontent.com/u/18556988?v=3","gravatar_id":"","url":"https://api.github.com/users/artifex85","html_url":"https://github.com/artifex85","followers_url":"https://api.github.com/users/artifex85/followers","following_url":"https://api.github.com/users/artifex85/following{/other_user}","gists_url":"https://api.github.com/users/artifex85/gists{/gist_id}","starred_url":"https://api.github.com/users/artifex85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artifex85/subscriptions","organizations_url":"https://api.github.com/users/artifex85/orgs","repos_url":"https://api.github.com/users/artifex85/repos","events_url":"https://api.github.com/users/artifex85/events{/privacy}","received_events_url":"https://api.github.com/users/artifex85/received_events","type":"User","site_admin":false},"created_at":"2016-07-07T18:06:12Z","updated_at":"2016-07-07T18:06:12Z","body":"birdsarah- do you have a new link to that test code? The one you have seems to be broken.\r\n\r\nThanks!"}}
{"actor":{"display_login":"artifex85"}}