-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Fixing issue #4902. #4904
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
Fixing issue #4902. #4904
Conversation
@alefnula Can you add a test if you aren't doing that already? Thanks :) |
release notes as well! |
@alefnula just fyi those are in |
Uh sorry, I'm not that familiar with the pandas project workflow yet. Can someone point me what should I add to release notes, and in which test suite/test file should the test for I'm really sorry for this many questions. :-/ |
@alefnula No problem.
def test_complex_mean(self):
df = DataFrame({'a': tm.choice(['a', 'b'], size=10), 'b': rand(10).astype(complex) + randn(10) * 1j})
result = df.mean().item()
expected = df['b'].values.mean()
self.assertEqual(result, expected) |
@cpcloud OK got it. One more question. |
@alefnula yes...can put it there....try to find a similar group of tests and try it (note that make sure its NOT under SafeForSparse), because I don't think this works on sparse |
@jreback I just found a |
@alefnula that's fine too |
@alefnula do you have travis hookup up? see contributing.md for instructions... |
Added tests, updated the |
@jreback Enabled travis. But saw your post too late, already pushed the changes. :-/ |
go ahead and set up travis, then
|
looks good....pls rebase and squash to 1 commit and should be mergeable |
no need to close .... |
@cpcloud I'm haven't closed it. Github automatically closed it when I rebased and pushed. |
strange |
yeah, that's not supposed to happen at all. very weird. |
wonder if the commit message has naything to do with it? |
It happened two times... When I did the amend and when I rebased :-/ |
that's very weird since "fixing" is not one of the words that closes an issue |
Extended _ensure_numeric to check if the value is a complex numbers. Also it now tries to convert the value to a complex number if conversion to float fails. Added PyDev project files to .gitignore.
thanks! |
closes #4902, Added a check for complex numbers.