Skip to content

Commit 19f0a9f

Browse files
authored
pandas docs json_normalize example (#36194)
Co-authored-by: Nidhi Zare <[email protected]>
1 parent 592126c commit 19f0a9f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/io/json/_normalize.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def _json_normalize(
176176
... 'fitness': {'height': 130, 'weight': 60}},
177177
... {'id': 2, 'name': 'Faye Raker',
178178
... 'fitness': {'height': 130, 'weight': 60}}]
179-
>>> json_normalize(data, max_level=0)
179+
>>> pandas.json_normalize(data, max_level=0)
180180
fitness id name
181181
0 {'height': 130, 'weight': 60} 1.0 Cole Volk
182182
1 {'height': 130, 'weight': 60} NaN Mose Reg
@@ -191,7 +191,7 @@ def _json_normalize(
191191
... 'fitness': {'height': 130, 'weight': 60}},
192192
... {'id': 2, 'name': 'Faye Raker',
193193
... 'fitness': {'height': 130, 'weight': 60}}]
194-
>>> json_normalize(data, max_level=1)
194+
>>> pandas.json_normalize(data, max_level=1)
195195
fitness.height fitness.weight id name
196196
0 130 60 1.0 Cole Volk
197197
1 130 60 NaN Mose Reg
@@ -208,7 +208,7 @@ def _json_normalize(
208208
... 'info': {'governor': 'John Kasich'},
209209
... 'counties': [{'name': 'Summit', 'population': 1234},
210210
... {'name': 'Cuyahoga', 'population': 1337}]}]
211-
>>> result = json_normalize(data, 'counties', ['state', 'shortname',
211+
>>> result = pandas.json_normalize(data, 'counties', ['state', 'shortname',
212212
... ['info', 'governor']])
213213
>>> result
214214
name population state shortname info.governor
@@ -219,7 +219,7 @@ def _json_normalize(
219219
4 Cuyahoga 1337 Ohio OH John Kasich
220220
221221
>>> data = {'A': [1, 2]}
222-
>>> json_normalize(data, 'A', record_prefix='Prefix.')
222+
>>> pandas.json_normalize(data, 'A', record_prefix='Prefix.')
223223
Prefix.0
224224
0 1
225225
1 2

0 commit comments

Comments
 (0)