Skip to content

Commit 3c3cb8a

Browse files
committed
BUG: handle empty lists in json_normalize
xref: pandas-dev#15534
1 parent 2340fb8 commit 3c3cb8a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pandas/io/json/normalize.py

+3
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ def _pull_field(js, spec):
157157

158158
return result
159159

160+
if isinstance(data, list) and len(data) is 0:
161+
return DataFrame()
162+
160163
# A bit of a hackjob
161164
if isinstance(data, dict):
162165
data = [data]

0 commit comments

Comments
 (0)