Skip to content

Commit ab15869

Browse files
committed
fix issues with pep8
1 parent 247124f commit ab15869

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

pandas/io/json/normalize.py

+14-13
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,16 @@ def json_normalize(data, record_path=None, meta=None,
123123
Parameters
124124
----------
125125
data : dict or list of dicts
126-
Unserialized JSON objects.
127-
record_path : string or list of string, default None
126+
Unserialized JSON objects
127+
record_path : str or list of string, default None
128128
Path in each object to list of records. If not passed, data will be
129129
assumed to be an array of records.
130130
meta : list of paths (string or list of strings), default None
131131
Fields to use as metadata for each record in resulting table.
132132
meta_prefix : string, default None
133133
record_prefix : string, default None
134134
If True, prefix records with dotted (?) path, e.g. foo.bar.field if
135-
path to records is ['foo', 'bar']
135+
path to records is ['foo', 'bar'].
136136
errors : {'raise', 'ignore'}, default 'raise'
137137
* 'ignore' : will ignore KeyError if keys listed in meta are not
138138
always present
@@ -148,11 +148,12 @@ def json_normalize(data, record_path=None, meta=None,
148148
.. versionadded:: 0.20.0
149149
150150
max_level : integer, default None
151-
Max no of levels(depth of dict) to normalize. None, normalizes all levels.
151+
Max no of levels(depth of dict) to normalize.
152+
if None, normalizes all levels.
152153
153154
.. versionadded:: 0.24.0
154155
155-
ignore_keys : list, keys to ignore, default 0
156+
ignore_keys : list, keys to ignore, default []
156157
List of keys that you do not want to normalize.
157158
158159
.. versionadded:: 0.24.0
@@ -177,16 +178,16 @@ def json_normalize(data, record_path=None, meta=None,
177178
>>> from pandas.io.json import json_normalize
178179
>>> data = [{'id': 1,
179180
... 'name': {'first': 'Coleen', 'last': 'Volk'},
180-
... "fitness":{"height":130, "weight":60}},
181+
... "fitness": {"height":130, "weight":60}},
181182
... {'name': {'given': 'Mose', 'family': 'Regner'},
182-
... "fitness":{"height":130, "weight":60}},
183+
... "fitness": {"height":130, "weight":60}},
183184
... {'id': 2, 'name': 'Faye Raker',
184-
... "fitness":{"height":130, "weight":60}}]
185+
... "fitness": {"height":130, "weight":60}}]
185186
>>> json_normalize(data, max_level=1, ignore_keys=["name"])
186-
fitness.height fitness.weight id name
187-
0 130 60 1.0 {'first': 'Coleen', 'last': 'Volk'}
188-
1 130 60 NaN {'given': 'Mose', 'family': 'Regner'}
189-
2 130 60 2.0 Faye Raker
187+
fitness.height fitness.weight id name
188+
0 130 60 1.0 {'first': 'Coleen', 'last': 'Volk'}
189+
1 130 60 NaN {'given': 'Mose', 'family': 'Regner'}
190+
2 130 60 2.0 Faye Raker
190191
191192
>>> data = [{'state': 'Florida',
192193
... 'shortname': 'FL',
@@ -305,10 +306,10 @@ def _recursive_extract(data, path, seen_meta, level=0):
305306
"{err} is not always present"
306307
.format(err=e))
307308
meta_vals[key].append(meta_val)
308-
309309
records.extend(recs)
310310

311311
_recursive_extract(data, record_path, {}, level=0)
312+
312313
result = DataFrame(records)
313314

314315
if record_prefix is not None:

0 commit comments

Comments
 (0)