Advertisement
Guest User

broken d3graph

a guest
Jan 18th, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.82 KB | None | 0 0
  1. ---------------------------------------------------------------------------
  2. TypeError Traceback (most recent call last)
  3. <ipython-input-7-a19f65f69d5a> in <module>()
  4. ----> 1 G
  5.  
  6. /usr/local/lib/python3.2/site-packages/IPython/core/displayhook.py in __call__(self, result)
  7. 240 self.update_user_ns(result)
  8. 241 self.log_output(format_dict)
  9. --> 242 self.finish_displayhook()
  10. 243
  11. 244 def flush(self):
  12.  
  13. /usr/local/lib/python3.2/site-packages/IPython/zmq/displayhook.py in finish_displayhook(self)
  14. 59 sys.stdout.flush()
  15. 60 sys.stderr.flush()
  16. ---> 61 self.session.send(self.pub_socket, self.msg, ident=self.topic)
  17. 62 self.msg = None
  18. 63
  19.  
  20. /usr/local/lib/python3.2/site-packages/IPython/zmq/session.py in send(self, stream, msg_or_type, content, parent, ident, buffers, subheader, track, header)
  21. 558
  22. 559 buffers = [] if buffers is None else buffers
  23. --> 560 to_send = self.serialize(msg, ident)
  24. 561 flag = 0
  25. 562 if buffers:
  26.  
  27. /usr/local/lib/python3.2/site-packages/IPython/zmq/session.py in serialize(self, msg, ident)
  28. 462 content = self.none
  29. 463 elif isinstance(content, dict):
  30. --> 464 content = self.pack(content)
  31. 465 elif isinstance(content, bytes):
  32. 466 # content is already packed, as in a relayed message
  33.  
  34. /usr/local/lib/python3.2/site-packages/IPython/zmq/session.py in <lambda>(obj)
  35. 77
  36. 78 # ISO8601-ify datetime objects
  37. ---> 79 json_packer = lambda obj: jsonapi.dumps(obj, default=date_default)
  38. 80 json_unpacker = lambda s: extract_dates(jsonapi.loads(s))
  39. 81
  40.  
  41. /usr/local/lib/python3.2/site-packages/zmq/utils/jsonapi.py in dumps(o, **kwargs)
  42. 70 kwargs['separators'] = (',', ':')
  43. 71
  44. ---> 72 return _squash_unicode(jsonmod.dumps(o, **kwargs))
  45. 73
  46. 74 def loads(s, **kwargs):
  47.  
  48. /usr/local/Cellar/python3/3.2.3/Frameworks/Python.framework/Versions/3.2/lib/python3.2/json/__init__.py in dumps(obj, skipkeys, ensure_ascii, check_circular, allow_nan, cls, indent, separators, default, **kw)
  49. 231 check_circular=check_circular, allow_nan=allow_nan, indent=indent,
  50. 232 separators=separators, default=default,
  51. --> 233 **kw).encode(obj)
  52. 234
  53. 235
  54.  
  55. /usr/local/Cellar/python3/3.2.3/Frameworks/Python.framework/Versions/3.2/lib/python3.2/json/encoder.py in encode(self, o)
  56. 186 # exceptions aren't as detailed. The list call should be roughly
  57. 187 # equivalent to the PySequence_Fast that ''.join() would do.
  58. --> 188 chunks = self.iterencode(o, _one_shot=True)
  59. 189 if not isinstance(chunks, (list, tuple)):
  60. 190 chunks = list(chunks)
  61.  
  62. /usr/local/Cellar/python3/3.2.3/Frameworks/Python.framework/Versions/3.2/lib/python3.2/json/encoder.py in iterencode(self, o, _one_shot)
  63. 244 self.key_separator, self.item_separator, self.sort_keys,
  64. 245 self.skipkeys, _one_shot)
  65. --> 246 return _iterencode(o, 0)
  66. 247
  67. 248 def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
  68.  
  69. /usr/local/lib/python3.2/site-packages/IPython/utils/jsonutil.py in date_default(obj)
  70. 89 return obj.strftime(ISO8601)
  71. 90 else:
  72. ---> 91 raise TypeError("%r is not JSON serializable"%obj)
  73. 92
  74. 93
  75.  
  76. TypeError: b'{"directed":false,"links":[{"source":0,"target":9},{"source":0,"target":18},{"source":0,"target":19},{"source":0,"target":4},{"source":0,"target":5},{"source":1,"target":3},{"source":1,"target":11},{"source":1,"target":6},{"source":1,"target":14},{"source":2,"target":17},{"source":2,"target":12},{"source":2,"target":13},{"source":2,"target":15},{"source":3,"target":6},{"source":3,"target":10},{"source":3,"target":11},{"source":3,"target":14},{"source":3,"target":16},{"source":4,"target":8},{"source":4,"target":9},{"source":4,"target":7},{"source":5,"target":18},{"source":5,"target":19},{"source":5,"target":13},{"source":5,"target":15},{"source":6,"target":16},{"source":6,"target":11},{"source":6,"target":14},{"source":7,"target":8},{"source":7,"target":9},{"source":8,"target":9},{"source":9,"target":14},{"source":9,"target":16},{"source":10,"target":16},{"source":10,"target":17},{"source":10,"target":11},{"source":10,"target":12},{"source":11,"target":14},{"source":12,"target":16},{"source":12,"target":17},{"source":13,"target":15},{"source":14,"target":16},{"source":14,"target":17},{"source":15,"target":18},{"source":16,"target":17},{"source":18,"target":19}],"multigraph":false,"graph":[["name","Random Geometric Graph"]],"handler":"d3graph","nodes":[{"pos":[0.33657335950224454,0.7142456581451647],"id":0},{"pos":[0.7442259028906747,0.10636290503841428],"id":1},{"pos":[0.6439614809723037,0.7569760720272561],"id":2},{"pos":[0.7966457875968777,0.24579102927351737],"id":3},{"pos":[0.21158895606665418,0.5006992064258619],"id":4},{"pos":[0.43450101687459175,0.9860336930710977],"id":5},{"pos":[0.6755120956697676,0.2472313217196801],"id":6},{"pos":[0.16679608675269997,0.3349676403675954],"id":7},{"pos":[0.04526151789210997,0.40570547308275673],"id":8},{"pos":[0.3433071151885261,0.41564074831129627],"id":9},{"pos":[0.8681553374962689,0.4984970161394494],"id":10},{"pos":[0.8753126423339177,0.36706552449347396],"id":11},{"pos":[0.7200551610518239,0.6700912223025374],"id":12},{"pos":[0.6973673835121166,0.9764515176966589],"id":13},{"pos":[0.5942525137334815,0.3582058949687341],"id":14},{"pos":[0.5177203580575322,0.9659441942188587],"id":15},{"pos":[0.5791869250010893,0.4449835337623078],"id":16},{"pos":[0.6194406842970386,0.5925306730739618],"id":17},{"pos":[0.23041333963198574,0.982441587185185],"id":18},{"pos":[0.2019450062574235,0.9587534838818086],"id":19}]}' is not JSON serializable
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement