-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Multi index slicing working only for the last label in the first level index #12697
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
so this is chained indexing on a multi-index. So a fully-qualified selection works:
Might be something odd going on with the indexers. If you'd have a look and see if you can spot where this is happening would be helpful. You can just use your tests script and step thru the debugger. |
I found the problem. It's the line in
Here is the document of the assume_unique of in1d():
but
|
@ruoyu0088 if you want to do a PR for this would be great (and set |
When I try to slice a multi indexed data frame, the slice interval is ignored for all the entries of the first level index except the last one. This only happens if the length of the slice is beyond a particular value (around 30 in the cases that I observed, but it is not the same across data frames).
This bug seems to have been introduced in version 0.17.1 as this works fine in version 0.16.4
Code Sample
Current Output
Expected Output
output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 2.7.11.final.0
python-bits: 64
OS: Linux
OS-release: 3.13.0-63-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: None
pandas: 0.18.0
nose: 1.3.7
pip: 8.1.0
setuptools: 20.2.2
Cython: 0.22.1
numpy: 1.10.4
scipy: 0.17.0
statsmodels: 0.6.1
xarray: None
IPython: 4.0.0-dev
sphinx: 1.4a1
patsy: 0.3.0
dateutil: 2.4.2
pytz: 2015.7
blosc: None
bottleneck: 1.0.0
tables: 3.2.0
numexpr: 2.4.4
matplotlib: 1.5.1
openpyxl: 1.8.5
xlrd: 0.9.3
xlwt: 1.0.0
xlsxwriter: 0.7.3
lxml: 3.4.4
bs4: 4.3.2
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.5
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.38.0
The text was updated successfully, but these errors were encountered: