@@ -135,6 +135,16 @@ def json_normalize(data, record_path=None, meta=None,
135
135
Examples
136
136
--------
137
137
138
+ >>> from pandas.io.json import json_normalize
139
+ >>> data = [{'id': 1, 'name': {'first': 'Coleen', 'last': 'Volk'}},
140
+ ... {'name': {'given': 'Mose', 'family': 'Regner'}},
141
+ ... {'id': 2, 'name': 'Faye Raker'}]
142
+ >>> json_normalize(data)
143
+ id name name.family name.first name.given name.last
144
+ 0 1.0 NaN NaN Coleen NaN Volk
145
+ 1 NaN NaN Regner NaN Mose NaN
146
+ 2 2.0 Faye Raker NaN NaN NaN NaN
147
+
138
148
>>> data = [{'state': 'Florida',
139
149
... 'shortname': 'FL',
140
150
... 'info': {
@@ -150,7 +160,6 @@ def json_normalize(data, record_path=None, meta=None,
150
160
... },
151
161
... 'counties': [{'name': 'Summit', 'population': 1234},
152
162
... {'name': 'Cuyahoga', 'population': 1337}]}]
153
- >>> from pandas.io.json import json_normalize
154
163
>>> result = json_normalize(data, 'counties', ['state', 'shortname',
155
164
... ['info', 'governor']])
156
165
>>> result
0 commit comments