Re: [Numpy-discussion] Decimal arrays?

2011-08-22 Thread Mark Dickinson
On Mon, Aug 22, 2011 at 4:07 PM, Chris Withers wrote: > On 22/08/2011 00:18, Mark Dickinson wrote: >> >> On Sun, Aug 21, 2011 at 1:08 AM, Robert Kern >>  wrote: >>> >>> You may want to try the cdecimal package: >>> >>>  http://pypi.py

Re: [Numpy-discussion] memoryview shape/strides representation for ndim = 0

2011-08-22 Thread Mark Dickinson
On Mon, Aug 22, 2011 at 1:30 PM, Stefan Krah wrote: > Numpy arrays and memoryview currently have different representations > for shape and strides if ndim = 0: > from numpy import * x = array(9, int32) x.ndim > 0 x.shape > () x.strides > () m = memoryview(x) m.nd

Re: [Numpy-discussion] Decimal arrays?

2011-08-22 Thread Mark Dickinson
On Sun, Aug 21, 2011 at 1:08 AM, Robert Kern wrote: > You may want to try the cdecimal package: > >  http://pypi.python.org/pypi/cdecimal/ I'll second this suggestion. cdecimal is an extraordinarily carefully written and well-tested (almost) drop-in replacement for the decimal module, and well w

[Numpy-discussion] nanmin() fails with 'TypeError: cannot reduce a scalar'. Numpy 1.6.0 regression?

2011-07-27 Thread Mark Dickinson
In NumPy 1.6.0, I get the following behaviour: Python 2.7.2 |EPD 7.1-1 (32-bit)| (default, Jul 3 2011, 15:40:35) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type "packages", "demo" or "enthought" for more information. >>> import numpy >>> numpy.nanmin(numpy.ma.masked_array([1,2,3,4])) Tracebac

Re: [Numpy-discussion] dealing with datetime UTC vs linear time

2011-06-07 Thread Mark Dickinson
On Mon, Jun 6, 2011 at 11:12 PM, Mark Wiebe wrote: > On Mon, Jun 6, 2011 at 3:47 PM, Mark Dickinson >> On Mon, Jun 6, 2011 at 9:24 PM, Mark Wiebe wrote: >> > and an ambiguity-resolution in the few cases that need it, >> >> Where does the ambiguity come from?  (

Re: [Numpy-discussion] dealing with datetime UTC vs linear time

2011-06-06 Thread Mark Dickinson
On Mon, Jun 6, 2011 at 9:24 PM, Mark Wiebe wrote: Sorry for being dense, but: > C. Add a metadata item which chooses between "UTC" and "TAI". For seconds > and finer, converting between UTC and TAI units is safe, and for minutes and > coarser, is unsafe. UTC involves leap-seconds This bit I und

Re: [Numpy-discussion] fixing up datetime

2011-06-06 Thread Mark Dickinson
On Thu, Jun 2, 2011 at 5:42 PM, Mark Wiebe wrote: > Leap years are easy compared with leap seconds. Leap seconds involve a > hardcoded table of particular leap-seconds that are added or subtracted, and > are specified roughly 6 months in advance of when they happen by > the International Earth Rot

Re: [Numpy-discussion] Conversion from structured dtype to object changed in Numpy 1.6.0.

2011-05-21 Thread Mark Dickinson
On Sat, May 21, 2011 at 9:25 PM, Mark Wiebe wrote: > On Thu, May 19, 2011 at 6:59 AM, Pauli Virtanen wrote: >> >> Thu, 19 May 2011 12:36:22 +0100, Mark Dickinson wrote: >> [clip] >> >>>> from numpy import array >> >>>> x = arr

[Numpy-discussion] Conversion from structured dtype to object changed in Numpy 1.6.0.

2011-05-19 Thread Mark Dickinson
With numpy 1.5.1: Python 2.7.1 |EPD 7.0-2 (32-bit)| (r271:86832, Dec 3 2010, 15:41:32) [GCC 4.0.1 (Apple Inc. build 5488)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from numpy import array >>> x = array((1.2, 2.3), dtype=[('field1', float), ('field2', fl