BUG: Categorical data fails to load from hdf when all columns are NaN
State: closed

- [x] closes #18413
- [x] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry: Allow storing NaN-only categorical columns in hdf5 store


Labels:
name: Bug
name: IO HDF5
description: read_hdf, HDFStore
name: Categorical
description: Categorical Data Type

Comments:
Hello @ssche! Thanks for updating the PR.





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

##### Comment last updated on December 10, 2017 at 15:54 Hours UTC
Thanks.  The whatsnew entry should be added to `pandas/doc/source/whatsnew/v0.22.0.txt` under the I/O subsection within the Bug Fixes section.
I’m keen to get this accepted. What’s the next step?
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18652?src=pr&el=h1) Report
> Merging [#18652](https://codecov.io/gh/pandas-dev/pandas/pull/18652?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/13f6267207dd1f140b12d7718277508eff5c1efb?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #18652      +/-   ##
==========================================
- Coverage   91.59%   91.57%   -0.02%     
==========================================
  Files         153      153              
  Lines       51221    51223       +2     
==========================================
- Hits        46917    46910       -7     
- Misses       4304     4313       +9
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.43% <0%> (-0.01%)` | :arrow_down: |
| #single | `40.68% <100%> (-0.1%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18652?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/pytables.py](https://codecov.io/gh/pandas-dev/pandas/pull/18652/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3B5dGFibGVzLnB5) | `92.84% <100%> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18652/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18652/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.81% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18652?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/18652?src=pr&el=footer). Last update [13f6267...e6aad40](https://codecov.io/gh/pandas-dev/pandas/pull/18652?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18652?src=pr&el=h1) Report
> Merging [#18652](https://codecov.io/gh/pandas-dev/pandas/pull/18652?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/1355df64af894836f86cbc75b0c3b1435331aeb4?src=pr&el=desc) will **decrease** coverage by `0.04%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #18652      +/-   ##
==========================================
- Coverage   91.61%   91.57%   -0.05%     
==========================================
  Files         153      153              
  Lines       51305    51307       +2     
==========================================
- Hits        47001    46982      -19     
- Misses       4304     4325      +21
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.43% <0%> (-0.03%)` | :arrow_down: |
| #single | `40.71% <100%> (-0.1%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18652?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/pytables.py](https://codecov.io/gh/pandas-dev/pandas/pull/18652/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3B5dGFibGVzLnB5) | `92.84% <100%> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18652/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/plotting/\_converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/18652/diff?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb252ZXJ0ZXIucHk=) | `64.78% <0%> (-1.74%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18652/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.81% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18652?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/18652?src=pr&el=footer). Last update [1355df6...b2ac7c4](https://codecov.io/gh/pandas-dev/pandas/pull/18652?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

@ssche had a linting error. this should be ok. ping on green.
thanks @ssche