ENH: add option chop_threshold to control display of small numerical values as zero #2739

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

y-p commented Jan 23, 2013

Doesn't cover complex numbers for now (no formatter implemented in format.py)

I think the "supress" kwd choice in numpy is not that awesome. So I borrowed chop from
the mathematica parlance.
#2734

Contributor

sglyon commented Jan 24, 2013

It does what I asked - Thanks!

There is one improvement I think we could make. Assuming I have set the precision option to 5, when displaying a chopped entry near other data in scientific format (something like 2.54443e-03), the chopped value will display as0.00000e+00. It would be nice if it just printed 0 instead of '0.' + '0' * precision + 'e+00'.

A side note, is there a way to control if things are printed in scientific format (with the e's)?

@y-p y-p ENH: add option chop_threshold to control display of small numerical …
…values as zero GH2735

Doesn't cover complex numbers for now.
65fa139
Contributor

y-p commented Jan 26, 2013

You can look at the code for pandas.set_eng_float_format to see how it's done,
and you can pass your own formatters to to_string() for even more control.

wesm was assigned Feb 10, 2013

Owner

wesm commented Feb 10, 2013

cherry picked. thanks

wesm closed this Feb 10, 2013

Contributor

y-p commented Mar 11, 2013

added mention to v0.11.0.txt and pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment