-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ERR: better error message on invalid on with multi-index columns #9455
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
show .info() on both frames |
Thanks @jreback
and
|
how did you create the columns ? |
the columns index mean |
I created the multi-index one (
Other than that, |
That said @jreback I have tried using |
Also, the following (flattening columns for
|
When you have a multi-index column, you have to specify the entire column depth in the on, IOW, a tuple. The error message could be better I think though. Want to submit a pull-request to improve that? |
Thanks @jreback I wonder if the following problem is related to this: Consider a dataframe that we populate as follows:
I end up with
and when I do:
I get:
|
And on that note, is there any way to recreate the index in the example above automatically? (e.g. pushing any index value with lower depth than the max depth of the axis to the highest and lower level, and creating, empty level values for any depth missing?) |
what you are doing is not supported, you need to use |
Thanks @jreback. That's good to know. I changed all my I will definitely try to improve the error message with a PR, but I think the problem I am having in my last two posts is different (unable to sort the index with columns with different depths). |
@amelio-vazquez-reina you cannot have columns of different depths; you think you do, but they are really all the same depth. |
Thanks @jreback. I understand now the problem. |
Consider the following:
and
I would like to do an inner join in
object_uid
. When I do:I get:
AttributeError: 'numpy.ndarray' object has no attribute 'start'
This is with:
The full error trace is below:
Also, the following works:
but it flattens my columns:
The text was updated successfully, but these errors were encountered: