Skip to content

BUG: Fixed _format_labels in tile.py for np.inf. #4954

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

Merged
merged 1 commit into from
Sep 25, 2013

Conversation

filmor
Copy link
Contributor

@filmor filmor commented Sep 23, 2013

Fixes issue #3415.

@jreback
Copy link
Contributor

jreback commented Sep 23, 2013

can you squash to 1 commit? looks good

@jreback
Copy link
Contributor

jreback commented Sep 23, 2013

if you want to put you test example in v0.13.0 you can (to sort of 'announce' this fix)..up2u

@filmor
Copy link
Contributor Author

filmor commented Sep 24, 2013

I did that, I hope adding the example to the documentation is okay.

One question: It's rather unmathematical to write (0, inf] (i.e. closed at infinity). Should we be correct about this and make the label (0, inf), resp. (-inf, 0), or do we prefer the uniformity?

@jreback
Copy link
Contributor

jreback commented Sep 24, 2013

@jtratner @cpcloud ?

@@ -114,6 +114,15 @@ def test_na_handling(self):
ex_result = np.where(com.isnull(arr), np.nan, result)
tm.assert_almost_equal(result, ex_result)

def test_inf_handling(self):
data = np.arange(6)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also test with Series? thx

@cpcloud
Copy link
Member

cpcloud commented Sep 24, 2013

@filmor Can u rebase?

Since the fractional part of np.inf is 0.0 it is enough to change the
formatter string in this case to the (nearly) equivalent "%.0f".
@filmor
Copy link
Contributor Author

filmor commented Sep 25, 2013

Done. The question still stands though, but it can be handled in a different PR.

@jreback
Copy link
Contributor

jreback commented Sep 25, 2013

I think it's more consistent to use the existing labeling scheme (even if technically mathematically incorrect)

@filmor
Copy link
Contributor Author

filmor commented Sep 25, 2013

That's fine with me :)

jreback added a commit that referenced this pull request Sep 25, 2013
BUG: Fixed _format_labels in tile.py for np.inf.
@jreback jreback merged commit fac7d1d into pandas-dev:master Sep 25, 2013
@jreback
Copy link
Contributor

jreback commented Sep 25, 2013

@filmor thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants