<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; idx = pd.CategoricalIndex(['low', 'low', 'hi', 'hi'])
&gt;&gt;&gt; idx.reindex(idx)[0].values
[low, low, low, low, hi, hi, hi, hi]
Categories (2, object): [hi, low]"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">idx</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">CategoricalIndex</span>([<span class="pl-s">'low'</span>, <span class="pl-s">'low'</span>, <span class="pl-s">'hi'</span>, <span class="pl-s">'hi'</span>])
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">idx</span>.<span class="pl-en">reindex</span>(<span class="pl-s1">idx</span>)[<span class="pl-c1">0</span>].<span class="pl-s1">values</span>
[<span class="pl-s1">low</span>, <span class="pl-s1">low</span>, <span class="pl-s1">low</span>, <span class="pl-s1">low</span>, <span class="pl-s1">hi</span>, <span class="pl-s1">hi</span>, <span class="pl-s1">hi</span>, <span class="pl-s1">hi</span>]
<span class="pl-v">Categories</span> (<span class="pl-c1">2</span>, <span class="pl-s1">object</span>): [<span class="pl-s1">hi</span>, <span class="pl-s1">low</span>]</pre></div>
<p dir="auto">I'm not sure that it is unexpected behavior, but it seems to be one of the reasons for <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="339197998" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/21809" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/21809/hovercard" href="https://github.com/pandas-dev/pandas/issues/21809">#21809</a></p>
<h4 dir="auto">Expected Output</h4>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/pandas-dev/pandas/commit/0a0b2b9fc56eb0753b6d07a55d497b970c8ccfe0/hovercard" href="https://github.com/pandas-dev/pandas/commit/0a0b2b9fc56eb0753b6d07a55d497b970c8ccfe0"><tt>0a0b2b9</tt></a><br>
python: 3.6.6.final.0<br>
python-bits: 64<br>
OS: Linux<br>
OS-release: 4.13.0-46-generic<br>
machine: x86_64<br>
processor: x86_64<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: en_US.UTF-8<br>
LOCALE: en_US.UTF-8</p>
<p dir="auto">pandas: 0.24.0.dev0+333.g0a0b2b9fc<br>
pytest: 3.6.2<br>
pip: 10.0.1<br>
setuptools: 39.2.0<br>
Cython: 0.28.3<br>
numpy: 1.14.5<br>
scipy: 1.1.0<br>
pyarrow: 0.9.0<br>
xarray: 0.10.7<br>
IPython: 6.4.0<br>
sphinx: 1.7.5<br>
patsy: 0.5.0<br>
dateutil: 2.7.3<br>
pytz: 2018.4<br>
blosc: None<br>
bottleneck: 1.2.1<br>
tables: 3.4.4<br>
numexpr: 2.6.5<br>
feather: 0.4.0<br>
matplotlib: 2.2.2<br>
openpyxl: 2.5.4<br>
xlrd: 1.1.0<br>
xlwt: 1.3.0<br>
xlsxwriter: 1.0.5<br>
lxml: 4.2.2<br>
bs4: 4.6.0<br>
html5lib: 1.0.1<br>
sqlalchemy: 1.2.8<br>
pymysql: 0.8.1<br>
psycopg2: None<br>
jinja2: 2.10<br>
s3fs: 0.1.5<br>
fastparquet: 0.1.5<br>
pandas_gbq: None<br>
pandas_datareader: None<br>
gcsfs: 0.1.0</p>
</details>
<p dir="auto">I have tried to find related issue but failed... so pardon me if it is a duplicate:</p>
<p dir="auto">ATM if groupping doesn't result in actually all possible combinations, the pandas spits out non-informative</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/home/yoh/deb/gits/pkg-exppsy/pandas/pandas/core/groupby.py in _aggregate_series_pure_python(self, obj, func, ngroups)
    431                     raise ValueError('function does not reduce')
    432 
--&gt; 433             counts[label] = group.shape[0]
    434             result[label] = res
    435 

IndexError: index out of bounds
&gt; /home/yoh/deb/gits/pkg-exppsy/pandas/pandas/core/groupby.py(433)_aggregate_series_pure_python()
    432 
--&gt; 433             counts[label] = group.shape[0]
    434             result[label] = res"><pre class="notranslate"><code class="notranslate">/home/yoh/deb/gits/pkg-exppsy/pandas/pandas/core/groupby.py in _aggregate_series_pure_python(self, obj, func, ngroups)
    431                     raise ValueError('function does not reduce')
    432 
--&gt; 433             counts[label] = group.shape[0]
    434             result[label] = res
    435 

IndexError: index out of bounds
&gt; /home/yoh/deb/gits/pkg-exppsy/pandas/pandas/core/groupby.py(433)_aggregate_series_pure_python()
    432 
--&gt; 433             counts[label] = group.shape[0]
    434             result[label] = res
</code></pre></div>
<p dir="auto">imho there could be an option to still handle those but place NaNs for those entries, OR at least spit out an informative exception something like "combination f1='x', f2='y' doesn't have data entries in the original data, or smth like that</p>