-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Groupby doesn't accept level=[0] for Index. #13901
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
Using |
I suppose this is legit, as |
ok, then the fix should include the support of |
ah sorry you refer to one length list, not |
yes @sinhrks we don't accept non-list-likes anywhere (meaning range) for things like this. They must be a list/tuple/array (or scalar in this case) |
@sinhrks Sorry for the confusion. In python2 range returns list and I totally forgot about the change in py3. |
In Python 3 |
Today I've found weird behaviour of level parameter of groupby. I need to groupby two dataframes by index and this code is working as long as I'm using Multiindex.
Unfortunately when I'm using simple Index I get:
In other way if I passed 0 instead of [0], everything is working properly. It's weird and cause that it's hard to write reusable code.
INSTALLED VERSIONS
commit: None
python: 2.7.12.final.0
python-bits: 64
OS: Linux
OS-release: 4.2.0-42-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_GB.UTF8
pandas: 0.18.1
nose: 1.3.7
pip: 8.1.2
setuptools: 20.3
Cython: None
numpy: 1.11.1
scipy: None
statsmodels: None
xarray: None
IPython: 4.2.0
sphinx: None
patsy: None
dateutil: 2.4.1
pytz: 2016.4
blosc: None
bottleneck: 1.1.0
tables: 3.2.2
numexpr: 2.6.0
matplotlib: 1.5.1
openpyxl: None
xlrd: None
xlwt: 1.1.2
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.13
pymysql: None
psycopg2: None
jinja2: None
boto: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: