-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
MultiIndexing Issue #8893
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
you will have to show some copy-pastable example. not really sure what you are trying to do, nor what error you are seeing. and show |
I am anticipating 'b' only, while I get ['a','b'] |
I want you to |
using
|
Let 'b' be a large dataframe with MulitiIndex.
I pull the 4th block based on the 1st level of the index, and I got the block fine.
Then I printed the index of the block, which also seemed fine, code and result as follows:
sequence attribute
4 count
price
quantity
and when I pull values, they seemed fine too:
array([(4L, 'count'), (4L, 'price'), (4L, 'quantity')], dtype=object)
but when I looked at it in a different way, things didn't make much sense:
MultiIndex(levels=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, ...], [u'count', u'price', u'quantity']],
labels=[[4, 4, 4], [0, 1, 2]],
names=[u'sequence', u'attribute'])
and when I pull the first level from the index of the block, I got:
Int64Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, ...], dtype='int64')
Which is not the
Int64Index([4], dtype='int64')
I anticipated.
Of course I can
and create the thing I am expecting, but this is a pain in the ass. Any solutions? Thanks!
The text was updated successfully, but these errors were encountered: