-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Groupby on multiindex with missing data in group keys raises IndexError #20519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yeah, I think this should return an empty series. |
May i take a look? |
There are 2
Why don't we create a new Exception such as |
…exError (pandas-dev#20519) * If all index values in some level is NA, fill with NaN
…exError (pandas-dev#20519) * If all index values in some level is NA, fill with NaN
…exError (pandas-dev#20519) * If all index values in some level is NA, fill with NaN
IndexError (pandas-dev#20519) * if all the values in a level of a MultiIndex were missing, fill with numpy nan
IndexError (pandas-dev#20519) * if all the values in a level of a MultiIndex were missing, fill with numpy nan
IndexError (pandas-dev#20519) *if all the values in a level of a MultiIndex were missing, fill with numpy nan
…exError (pandas-dev#20519) * if all the values in a level of a MultiIndex were missing, fill with numpy nan
…exError (pandas-dev#20519) * if all the values in a level of a MultiIndex were missing, fill with numpy nan
…exError (pandas-dev#20519) * if all the values in a level of a MultiIndex were missing, fill with numpy nan
…exError (pandas-dev#20519) * if all the values in a level of a MultiIndex were missing, fill with numpy nan
…exError (pandas-dev#20519) * if all the values in a level of a MultiIndex were missing, fill with numpy nan
…exError (pandas-dev#20519) * if all the values in a level of a MultiIndex were missing, fill with numpy nan
…exError (pandas-dev#20519) * if all the values in a level of a MultiIndex were missing, fill with numpy nan
…exError (pandas-dev#20519) * if all the values in a level of a MultiIndex were missing, fill with numpy nan
Code Sample, a copy-pastable example if possible
Problem description
It would be better if pandas can either return the same result as the 'bar' case, or raise another meaningful exception and document this case somewhere (e.g. here))
Expected Output
Series([], Name: C, dtype: int64)
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 2.7.12.final.0
python-bits: 64
OS: Linux
OS-release: 3.10.0-229.el7.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.18.1
nose: None
pip: None
setuptools: None
Cython: None
numpy: 1.10.4
scipy: None
statsmodels: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.4.2
pytz: 2016.4
blosc: None
bottleneck: 1.0.0
tables: None
numexpr: 2.4.6
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: 0.9.2
apiclient: 1.2
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
boto: 2.22.1
pandas_datareader: None
The text was updated successfully, but these errors were encountered: