BBands wrote:
> If I have a NumPy array like so:
>
> [[1, 12],
> [2, 13],
> [3, 14],
> [4, 15],
> [5, 16],
> [6, 15],
> [7, 14]]
>
> How can I do an inplace diff, ending up with this?
>
> [[1, 0],
> [2, 1],
> [3, 1],
> [4, 1],
> [5, 1],
> [6, -1],
> [7, -1]]
>>> import numpy as N
BBands wrote:
>If I have a NumPy array like so:
>
>[[1, 12],
> [2, 13],
> [3, 14],
> [4, 15],
> [5, 16],
> [6, 15],
> [7, 14]]
>
>How can I do an inplace diff, ending up with this?
>
>[[1, 0],
> [2, 1],
> [3, 1],
> [4, 1],
> [5, 1],
> [6, -1],
> [7, -1]]
>
>
Probably can be done (but it's a bit
If I have a NumPy array like so:
[[1, 12],
[2, 13],
[3, 14],
[4, 15],
[5, 16],
[6, 15],
[7, 14]]
How can I do an inplace diff, ending up with this?
[[1, 0],
[2, 1],
[3, 1],
[4, 1],
[5, 1],
[6, -1],
[7, -1]]
Also, can I covert to natural logs in place?
[[1, 2.4849],
[2, 2.5649],
[
On 1/26/07, Travis Oliphant <[EMAIL PROTECTED]> wrote:
> Stefan correctly identified the problem. The dimension-discovery code
> is getting confused.
> This might actually be a fixable bug. But, in general getting the
> N.array() code to correctly guess where the "Object-line" should be
> draw
Fernando Perez wrote:
>Hi all,
>
>I'm puzzled by this behavior a colleague ran into:
>
>In [38]: p1=N.poly1d([1.])
>
>In [39]: a=N.array([p1],dtype='O')
>
>In [40]: a
>Out[40]: array([], shape=(1, 0), dtype=object)
>
>In [42]: print a
>[]
>
>
>
Stefan correctly identified the problem. The dim
On Friday 26 January 2007 21:45, Travis Oliphant wrote:
> Martin Wiechert wrote:
> >On Friday 26 January 2007 21:03, Robert Kern wrote:
> >>Martin Wiechert wrote:
> >>>Hi gurus,
> >>>
> >>>is it (in C) safe to deallocate an array of type NPY_OBJECT, which
> >>>carries NULL pointers?
> >>
> >>Possib
Martin Wiechert wrote:
>On Friday 26 January 2007 21:03, Robert Kern wrote:
>
>
>>Martin Wiechert wrote:
>>
>>
>>>Hi gurus,
>>>
>>>is it (in C) safe to deallocate an array of type NPY_OBJECT, which
>>>carries NULL pointers?
>>>
>>>
>>Possibly, I'm not sure without doing some more code-
Sebastian Haase wrote:
> On 1/26/07, Robert Kern <[EMAIL PROTECTED]> wrote:
>> Sebastian Haase wrote:
>>
>>> The easiest would be to be able to disable the long double functions.
>> Actually, there are a number of other configuration items that are
>> discovered by
>> compiling small C programs an
On 1/26/07, Robert Kern <[EMAIL PROTECTED]> wrote:
> Sebastian Haase wrote:
>
> > The easiest would be to be able to disable the long double functions.
>
> Actually, there are a number of other configuration items that are discovered
> by
> compiling small C programs and running them. There are a
On Friday 26 January 2007 21:03, Robert Kern wrote:
> Martin Wiechert wrote:
> > Hi gurus,
> >
> > is it (in C) safe to deallocate an array of type NPY_OBJECT, which
> > carries NULL pointers?
>
> Possibly, I'm not sure without doing some more code-diving. However, I
> strongly doubt that many othe
Sebastian Haase wrote:
> The easiest would be to be able to disable the long double functions.
Actually, there are a number of other configuration items that are discovered by
compiling small C programs and running them. There are a number of them that
might give different answers on 10.3.9 if th
On Fri, Jan 26, 2007 at 12:25:27PM -0700, Fernando Perez wrote:
> Hi all,
>
> I'm puzzled by this behavior a colleague ran into:
>
> In [38]: p1=N.poly1d([1.])
>
> In [39]: a=N.array([p1],dtype='O')
>
> In [40]: a
> Out[40]: array([], shape=(1, 0), dtype=object)
>
> In [42]: print a
> []
>
>
Martin Wiechert wrote:
> Hi gurus,
>
> is it (in C) safe to deallocate an array of type NPY_OBJECT, which carries
> NULL pointers?
Possibly, I'm not sure without doing some more code-diving. However, I strongly
doubt that many other operations are safe. Depending on how you got such an
array and
Hi gurus,
is it (in C) safe to deallocate an array of type NPY_OBJECT, which carries
NULL pointers?
TIA,
Martin
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Hi all,
I'm puzzled by this behavior a colleague ran into:
In [38]: p1=N.poly1d([1.])
In [39]: a=N.array([p1],dtype='O')
In [40]: a
Out[40]: array([], shape=(1, 0), dtype=object)
In [42]: print a
[]
In [43]: N.__version__
Out[43]: '1.0.2.dev3512'
He saw it running r3520 as well.
This looks
Charles R Harris wrote:
> This would be easy to add. I could put in an option side='mask' that
> would return 1 if the object is found, 0 otherwise. The type would be
> integer rather than boolean but I don't see that as a big problem. If I
> add that, I would like to change the keyword to mode in
I filed a similar bug report the other day. I believe that it has to do
with the default size of the accumulator variable in the algorithms
being used. Please see the following example,
Python 2.4.3 (#2, Dec 7 2006, 11:01:45)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help"
On 1/25/07, Robert Cimrman <[EMAIL PROTECTED]> wrote:
Robert Cimrman wrote:
> Charles R Harris wrote:
>>
>> In [7]: def countmembers(a1, a2) :
>> ...: a = sort(a2)
>> ...: il = a.searchsorted(a1, side='l')
>> ...: ir = a.searchsorted(a1, side='r')
>> ...: return ir - il
>
On Tue, Jan 23, 2007 at 08:29:47PM -0500, Daniel Smith wrote:
> When calling the average() or mean() functions on a small array (3
> numbers), I am seeing significant numerical errors (on the order of 1%
> with data to 8 significant digits). The code I am using is essentially:
>
> A = zeros(3)
>
On 1/23/07, Daniel Smith <[EMAIL PROTECTED]> wrote:
> When calling the average() or mean() functions on a small array (3
> numbers), I am seeing significant numerical errors (on the order of 1%
> with data to 8 significant digits). The code I am using is essentially:
>
> A = zeros(3)
>
> A[i] = X
>
When calling the average() or mean() functions on a small array (3
numbers), I am seeing significant numerical errors (on the order of 1%
with data to 8 significant digits). The code I am using is essentially:
A = zeros(3)
A[i] = X
B = average(A)
Is there something else I need to call to get
Hi,
I am trying to build Numpy-1.01 in windows using "python setup.py
build". My C compiler is MSVS2005. The compiler throws an error about
umathmodule.c:
"__umath_generated.c(72): error C2099: initializer is not a constant."
Tried with Numeric-24.2, it gives the same error.
The line of code
I just finished porting PyGame to use NumPy. It seemed to work fine. I
ran only a few demos though, and so haven't fleshed out all the details.
Please encourage library-writers to use NumPy when possible.
-Travis
Index: src/surfarray.c
=
23 matches
Mail list logo