Skip to content

Commit b9751e9

Browse files
author
Felix Marczinowski
committed
add test for #13213
1 parent 2429ec5 commit b9751e9

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

pandas/tests/frame/test_json.py

+26
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)