[Numpy-discussion] Decimal arrays?
Charles R Harris
Sat Aug 20 18:41:49 CDT 2011
On Sat, Aug 20, 2011 at 4:49 PM, Chris Withers <firstname.lastname@example.org>wrote:
> On 20/08/2011 15:38, Robert Kern wrote:
> > On Sat, Aug 20, 2011 at 17:37, Chris Withers<email@example.com>
> >> Hi All,
> >> What's the best type of array to use for decimal values?
> >> (ie: where I care about precision and want to avoid any possible
> >> rounding errors)
> > dtype=object
> What are the performance implications, if any, of this array type?
It will be slower, the effect depends on how much data/computation you have.
You need to look into using the decimal objects in decimal
i.e., import decimal. Note that 1/7 still isn't going to be exact in
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion