-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
can't select a specific column from a HDFStore table with a MultiIndex DataFrame #6169
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
this is a bug, because of the way multi-index are stored, they are columns and so much be retrieved EVEN when specifiying the columns filter. care to do a PR to fix (slightly but not too tricky) |
I guess I can give it a shot... |
So I did some digging, and I think I got the problem well defined, but not the solution. First, for anyone passing by, this works: ixs = store.select('df_mi', columns=['A']) as well as that: ixs = store.select('df_mi', "foo_name='bar'", columns=['A']) So the problem is in the implementation of the if columns is not None:
for n in self.levels:
if n not in columns:
columns.insert(0, n) From that, the columns containing the index won't be retrieved, because they are absent of the So the only way I see is to somehow modify the |
so, start off by writing some tests (which use your example), to try to get it to fail. Then step thru that example to see where the issue is. |
Well I guess I understood the issue, but I don't see how to solve it, because as far as I understand it implies something like modifying the |
welll easiest is simply to raise an when writing the tests as a PR would be great though |
I'm running in what seems to be a bug.
I'm using pandas version '0.13.0rc1-29-ga0a527b' from github, python 3.3 on a linux Mint 15 64 bits.
Here's a minimal example that fails:
And here is the error message:
The text was updated successfully, but these errors were encountered: