{"action":"closed","issue":{"url":"https://api.github.com/repos/pandas-dev/pandas/issues/14825","repository_url":"https://api.github.com/repos/pandas-dev/pandas","labels_url":"https://api.github.com/repos/pandas-dev/pandas/issues/14825/labels{/name}","comments_url":"https://api.github.com/repos/pandas-dev/pandas/issues/14825/comments","events_url":"https://api.github.com/repos/pandas-dev/pandas/issues/14825/events","html_url":"https://github.com/pandas-dev/pandas/issues/14825","id":194264855,"number":14825,"title":"to_json() output format issue","user":{"login":"hupili","id":1227160,"avatar_url":"https://avatars.githubusercontent.com/u/1227160?v=3","gravatar_id":"","url":"https://api.github.com/users/hupili","html_url":"https://github.com/hupili","followers_url":"https://api.github.com/users/hupili/followers","following_url":"https://api.github.com/users/hupili/following{/other_user}","gists_url":"https://api.github.com/users/hupili/gists{/gist_id}","starred_url":"https://api.github.com/users/hupili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hupili/subscriptions","organizations_url":"https://api.github.com/users/hupili/orgs","repos_url":"https://api.github.com/users/hupili/repos","events_url":"https://api.github.com/users/hupili/events{/privacy}","received_events_url":"https://api.github.com/users/hupili/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-08T07:22:40Z","updated_at":"2016-12-08T15:01:08Z","closed_at":"2016-12-08T15:01:08Z","body":"https://github.com/hupili/pandas-to-json-multi-index-issue/blob/master/pandas%20to_json%20test.ipynb\r\n\r\n#### Code Sample, a copy-pastable example if possible\r\n\r\n```python\r\n\r\ndf = pd.DataFrame(\r\n    [\r\n        ['1', '2', 'a'],\r\n        ['1', '3', 'b'],\r\n        ['2', '4', 'c'],\r\n        ['3', '5', 'd']\r\n    ],\r\n    columns=['key1', 'key2', 'key3']\r\n)\r\nj = df.set_index(['key1', 'key2']).to_json()\r\njson.loads(j)\r\n\r\n```\r\n#### Problem description\r\n\r\nThe exported JSON is ill-formatted\r\n\r\n```\r\n---------------------------------------------------------------------------\r\nJSONDecodeError                           Traceback (most recent call last)\r\n<ipython-input-8-5f4db1ed154c> in <module>()\r\n----> 1 json.loads(j)\r\n\r\n/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/json/__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)\r\n    317             parse_int is None and parse_float is None and\r\n    318             parse_constant is None and object_pairs_hook is None and not kw):\r\n--> 319         return _default_decoder.decode(s)\r\n    320     if cls is None:\r\n    321         cls = JSONDecoder\r\n\r\n/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/json/decoder.py in decode(self, s, _w)\r\n    337 \r\n    338         \"\"\"\r\n--> 339         obj, end = self.raw_decode(s, idx=_w(s, 0).end())\r\n    340         end = _w(s, end).end()\r\n    341         if end != len(s):\r\n\r\n/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/json/decoder.py in raw_decode(self, s, idx)\r\n    353         \"\"\"\r\n    354         try:\r\n--> 355             obj, end = self.scan_once(s, idx)\r\n    356         except StopIteration as err:\r\n    357             raise JSONDecodeError(\"Expecting value\", s, err.value) from None\r\n\r\nJSONDecodeError: Expecting ':' delimiter: line 1 column 13 (char 12)\r\n\r\n```\r\n\r\n#### Expected Output\r\n\r\n#### Output of ``pd.show_versions()``\r\n\r\n<details>\r\nINSTALLED VERSIONS\r\n------------------\r\ncommit: None\r\npython: 3.5.1.final.0\r\npython-bits: 64\r\nOS: Darwin\r\nOS-release: 16.1.0\r\nmachine: x86_64\r\nprocessor: i386\r\nbyteorder: little\r\nLC_ALL: en_US.UTF-8\r\nLANG: en_US.UTF-8\r\n\r\npandas: 0.18.1\r\nnose: 1.3.7\r\npip: 7.1.2\r\nsetuptools: 28.6.1\r\nCython: None\r\nnumpy: 1.11.2\r\nscipy: 0.18.1\r\nstatsmodels: None\r\nxarray: None\r\nIPython: 5.1.0\r\nsphinx: None\r\npatsy: None\r\ndateutil: 2.5.3\r\npytz: 2016.7\r\nblosc: None\r\nbottleneck: None\r\ntables: None\r\nnumexpr: None\r\nmatplotlib: 1.4.3\r\nopenpyxl: None\r\nxlrd: None\r\nxlwt: None\r\nxlsxwriter: None\r\nlxml: None\r\nbs4: 4.5.1\r\nhtml5lib: None\r\nhttplib2: 0.9.2\r\napiclient: 1.5.4\r\nsqlalchemy: 1.1.2\r\npymysql: None\r\npsycopg2: 2.6.2 (dt dec pq3 ext lo64)\r\njinja2: 2.8\r\nboto: 2.43.0\r\npandas_datareader: None\r\nIn [4]:\r\n</details>\r\n"}}
{"actor":{"display_login":"chris-b1"}}