We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2429ec5 commit b9751e9Copy full SHA for b9751e9
pandas/tests/frame/test_json.py
@@ -0,0 +1,26 @@
1
+# -*- coding: utf-8 -*-
2
+""""""
3
+
4
+from __future__ import (absolute_import, division, print_function)
5
6
+import pandas.util.testing as tm
7
+import pandas as pd
8
+import json
9
10
11
+class TestJSON(tm.TestCase):
12
+ testjson = u'''
13
+ [{"Ünicøde":0,"sub":{"A":1, "B":2}},
14
+ {"Ünicøde":1,"sub":{"A":3, "B":4}}]
15
+ '''.encode('utf8')
16
17
+ testdata = {
18
+ u'sub.A': [1, 3],
19
+ u'sub.B': [2, 4],
20
+ u'Ünicøde': [0, 1]
21
+ }
22
+ testdf = pd.DataFrame(testdata)
23
24
+ def test_json_normalize(self):
25
+ df = pd.io.json.json_normalize(json.loads(self.testjson))
26
+ tm.assert_frame_equal(df, self.testdf)
0 commit comments