Re: [Numpy-discussion] Bug or feature?

2011-08-22 Thread Konrad Hinsen
On 22 Aug 2011, at 14:50, Travis Oliphant wrote: > This goes into the category of "feature". Structured arrays use > tuples to indicate a record. So, (only) when using structured > arrays as a dtype, there is a difference between lists and > tuples.In this case, array sees the tuple a

Re: [Numpy-discussion] Decimal arrays?

2011-08-22 Thread Robert Kern
On Mon, Aug 22, 2011 at 10:07, 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.python.org/pypi/cdecimal/ >> >> I'll second this suggestion.  cdecimal is an

Re: [Numpy-discussion] Segfault for np.lookfor

2011-08-22 Thread Matthew Brett
Hi, On Sun, Aug 21, 2011 at 1:53 AM, Ben Walsh wrote: > > Hi > > My bad. Very sorry about that, guys. > > There's a patch for this here: > > https://github.com/walshb/numpy/tree/fix_np_lookfor_segv > > And I submitted a pull request. I'll add something to the tests too when I > have a little more

Re: [Numpy-discussion] numpy segfaults with ctypes

2011-08-22 Thread Angus McMorland
On 19 August 2011 16:11, Matthew Brett wrote: > Hi, > > On Fri, Aug 19, 2011 at 1:04 PM, Angus McMorland wrote: >> Hi all, >> >> I'm giving this email a new subject, in case that helps it catch the >> attention of someone who can fix my problem. I currently cannot >> upgrade numpy from git to any

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.python.org/pypi/cdecimal/ >> >> I'll second this suggestion.  cdec

Re: [Numpy-discussion] Decimal arrays?

2011-08-22 Thread Chris Withers
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.python.org/pypi/cdecimal/ > > I'll second this suggestion. cdecimal is an extraordinarily carefully > written and well-tested (almost)

Re: [Numpy-discussion] Bug or feature?

2011-08-22 Thread Travis Oliphant
This goes into the category of "feature". Structured arrays use tuples to indicate a record. So, (only) when using structured arrays as a dtype, there is a difference between lists and tuples.In this case, array sees the tuple and expects it to have 2 elements to match the number of field

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

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

2011-08-22 Thread Stefan Krah
Hello, 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.ndim 0L >>> m.shape is None True >>> m.strides is None True I t

[Numpy-discussion] Bug or feature?

2011-08-22 Thread Konrad Hinsen
Hi everyone, I just stumbled on a behavior in NumPy for which I can't find an explanation in the documentation. I wonder whether this is a bug or an undocumented (or badly documented) feature: -- import numpy

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