-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DataFrame self-joins #2996
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
Doesn't this do what you want?
or
|
Cheers, that does the trick. I'll close this Issue. |
In pandas 0.16.2 I get the following error when trying to attempt a join like this, using the following code to add one column:
results in
This error also seems to have been reproduced by another user: http://stackoverflow.com/q/24091385/586086 |
you would have to show the input frame |
Also, Oh, and pandas |
@TomAugspurger: @wesm used the series in place of strings in his post above. In any case, that syntax produces the same error:
@jreback, the info you requested (See here for a description of the data):
|
Is this what you want?
|
Given the following DataFrame
it would be nice if there were a way of grouping say columns
area
andpoint
and comparing thevalue
pertest
> 1 with the value fortest
- 1.This can be done by iterating over
df.groupby(['area', 'point', 'test'])
and using the sorting provided bygroupby()
on the specified columns to compare current and previousvalue
s. However, it would be neat if this could also be done in a more Pandas-esque way using something akin to a SQL self-join.NB request first made in pystatsmodels Google Group; was asked by Wes to create a Github issue for this.
The text was updated successfully, but these errors were encountered: