df.groupby(x).size() has behavior is different on MacOSX and Linux
#### Code Sample

```python
import pandas as pd
import numpy as np
data = pd.DataFrame({"A":[1,2,3,4], "B":[np.nan, np.nan, np.nan, np.nan]})
data.groupby(['B']).size()
```
#### Problem description
On MacOSX, this returns an empty series. On Linux, an exception is thrown.


#### Expected Output

Both Operating Systems should return an empty series.

#### Output of ``pd.show_versions()``


<details>

INSTALLED VERSIONS
------------------
commit: None
python: 2.7.15.final.0
python-bits: 64
OS: Linux
OS-release: 4.15.0-23-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: None.None

pandas: 0.23.4
pytest: None
pip: 10.0.1
setuptools: 40.2.0
Cython: None
numpy: 1.15.2
scipy: None
pyarrow: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.7.3
pytz: 2018.5
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
sqlalchemy: 1.2.12
pymysql: None
psycopg2: 2.7.5 (dt dec pq3 ext lo64)
jinja2: None
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
</details>
