BUG: Fix empty Data frames to JSON round-trippable back to data frames
State: closed

[x] closes #21287
[x] tests added / passed
[x]passes git diff upstream/master -u -- "*.py" | flake8 --diff
[x]whatsnew entry

Fixes the bug occurring when empty DF, previously saved to JSON-file, is read from JSON back to DF.

Labels:
name: Bug
name: IO JSON
description: read_json, to_json, json_normalize

Comments:
Can you add a test to cover this?
Sure, I'll add those both!
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/21318?src=pr&el=h1) Report
> Merging [#21318](https://codecov.io/gh/pandas-dev/pandas/pull/21318?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/8d5032a8c7b00d47fe5d0886145e1ad9dd17e0d3?src=pr&el=desc) will **decrease** coverage by `0.03%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/21318/graphs/tree.svg?height=150&width=650&token=eZ4WkYLtcO&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/21318?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #21318      +/-   ##
==========================================
- Coverage   91.89%   91.85%   -0.04%     
==========================================
  Files         153      153              
  Lines       49596    49570      -26     
==========================================
- Hits        45576    45533      -43     
- Misses       4020     4037      +17
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.25% <100%> (-0.04%)` | :arrow_down: |
| #single | `41.86% <0%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/21318?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/json/table\_schema.py](https://codecov.io/gh/pandas-dev/pandas/pull/21318/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2pzb24vdGFibGVfc2NoZW1hLnB5) | `98.29% <100%> (ø)` | :arrow_up: |
| [pandas/plotting/\_core.py](https://codecov.io/gh/pandas-dev/pandas/pull/21318/diff?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb3JlLnB5) | `82.39% <0%> (-1.15%)` | :arrow_down: |
| [pandas/core/dtypes/missing.py](https://codecov.io/gh/pandas-dev/pandas/pull/21318/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL21pc3NpbmcucHk=) | `91.95% <0%> (-0.58%)` | :arrow_down: |
| [pandas/core/dtypes/cast.py](https://codecov.io/gh/pandas-dev/pandas/pull/21318/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2Nhc3QucHk=) | `88.06% <0%> (-0.16%)` | :arrow_down: |
| [pandas/core/ops.py](https://codecov.io/gh/pandas-dev/pandas/pull/21318/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvb3BzLnB5) | `96.35% <0%> (-0.06%)` | :arrow_down: |
| [pandas/core/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/21318/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc2VyaWVzLnB5) | `94.12% <0%> (-0.06%)` | :arrow_down: |
| [pandas/core/reshape/merge.py](https://codecov.io/gh/pandas-dev/pandas/pull/21318/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9tZXJnZS5weQ==) | `94.25% <0%> (ø)` | :arrow_up: |
| [pandas/io/json/normalize.py](https://codecov.io/gh/pandas-dev/pandas/pull/21318/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2pzb24vbm9ybWFsaXplLnB5) | `96.93% <0%> (+0.06%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/21318?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/21318?src=pr&el=footer). Last update [8d5032a...8d5f127](https://codecov.io/gh/pandas-dev/pandas/pull/21318?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

Thanks for the comments! I'll look into this later today.
Hello @pyryjook! Thanks for updating the PR.





Cheers ! There are no PEP8 issues in this Pull Request. :beers: 

##### Comment last updated on June 08, 2018 at 23:39 Hours UTC
Great, I just resolved the merge conflicts in the whatsnew file.
thanks @pyryjook