[IPython-dev] Engineering formatting

Stéfan van der Walt stefan@sun.ac...
Sat Apr 24 13:35:42 CDT 2010


Hey Warren, Robert

On 21 April 2010 18:17, Warren Weckesser <warren.weckesser@enthought.com> wrote:
> Robert Kern wrote:
>> On 4/19/10 3:37 PM, Stéfan van der Walt wrote:
>>
>>> Hi all,
>>>
>>> This is probably an easy question, but how do I tweak IPython to
>>> display my numerical results in engineering notation?
>>>
>>
>> Use the pretty extension! In your ipy_user_conf.py:
[...]
> Following Robert's example, but defining float_eng_pprinter like this:
>
> def float_eng_pprinter(obj, p, cycle):
>   p.text(eng_format(obj))
[...]

Thanks for the code snippets!  I've put them into a profile and added
array printing (attached).  Maybe a useful profile to distribute?

Regards
Stéfan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipython_config_eng.py
Type: text/x-python-script
Size: 1671 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/ipython-dev/attachments/20100424/e3f4e988/attachment.bin 


More information about the IPython-dev mailing list