-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: GH14233 resample().median() failed if duplicate column names wer… #15202
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
Conversation
@@ -2203,7 +2203,6 @@ def agg_series(self, obj, func): | |||
# cython aggregation | |||
|
|||
_cython_functions = copy.deepcopy(BaseGrouper._cython_functions) | |||
_cython_functions['aggregate'].pop('median') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, I remember something was failing because of this.......
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran nosetests locally, and it works. I looked back at old versions, and I think it is a legacy issue of how the cython stuff was implemented over time.
def test_median_duplicate_columns(self): | ||
# GH 14233 | ||
|
||
df = pd.DataFrame(np.array([[i + j for i in range(20)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you use the repro from the original issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only difference is using np.random.randn()
versus the sequence I put in there, which makes it easier to debug. I can put the randn()
if you want.
lgtm. ping on green. |
thanks! |
Simple fix for median issue. Should use cython implementation. closes pandas-dev#14233 Author: Dr-Irv <[email protected]> Closes pandas-dev#15202 from Dr-Irv/Issue14233 and squashes the following commits: 6e0d900 [Dr-Irv] Use randn in test 1a3b4aa [Dr-Irv] BUG: GH14233 resample().median() failed if duplicate column names were present
Simple fix for median issue. Should use cython implementation.
git diff upstream/master | flake8 --diff