Skip to content

Commit

Permalink
BUG: handle empty lists in json_normalize
Browse files Browse the repository at this point in the history
  • Loading branch information
rgbkrk committed Mar 1, 2017
1 parent 2340fb8 commit 3c3cb8a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pandas/io/json/normalize.py
Expand Up @@ -157,6 +157,9 @@ def _pull_field(js, spec):

return result

if isinstance(data, list) and len(data) is 0:
return DataFrame()

# A bit of a hackjob
if isinstance(data, dict):
data = [data]
Expand Down

0 comments on commit 3c3cb8a

Please sign in to comment.