Neal Becker wrote:
> This is a bit confusing to me:
>
> import numpy as np
>
> u = np.ones ((3,3))
>
> for u_row in u:
> u_row = u_row * 2 << doesn't work
>
>
Try this instead:
for u_row in u:
u_row[:] = u_row * 2
Warren
> print u
> [[ 1. 1. 1.]
> [ 1. 1. 1.]
> [ 1. 1. 1.]]
On Wed, Mar 10, 2010 at 18:19, Neal Becker wrote:
> This is a bit confusing to me:
>
> import numpy as np
>
> u = np.ones ((3,3))
>
> for u_row in u:
> u_row = u_row * 2 << doesn't work
>
> print u
> [[ 1. 1. 1.]
> [ 1. 1. 1.]
> [ 1. 1. 1.]]
>
> for u_row in u:
> u_row *= 2 << does
This is a bit confusing to me:
import numpy as np
u = np.ones ((3,3))
for u_row in u:
u_row = u_row * 2 << doesn't work
print u
[[ 1. 1. 1.]
[ 1. 1. 1.]
[ 1. 1. 1.]]
for u_row in u:
u_row *= 2 << does work
[[ 2. 2. 2.]
[ 2. 2. 2.]
[ 2. 2. 2.]]
Naively, I'm thinking a
On Wed, Mar 10, 2010 at 10:39 AM, Bruce Southey wrote:
> On 03/10/2010 08:59 AM, Pauli Virtanen wrote:
> > Wed, 10 Mar 2010 15:40:04 +0100, Johann Cohen-Tanugi wrote:
> >
> >> Pauli, isn't it hopeless to follow the execution of the source code when
> >> the crash actually occurs when I exit, and
> Jerome Esteve wrote:
>> Is there a way to give an integer value to j when using a[i:j:-1] so
>> that the first element of the array can be included in the slice ?
Is this what you are looking for?
In [11]: a = np.arange(10)
In [12]: a[6::-1]
Out[12]: array([6, 5, 4, 3, 2, 1, 0])
I know it's
On 03/10/2010 08:59 AM, Pauli Virtanen wrote:
> Wed, 10 Mar 2010 15:40:04 +0100, Johann Cohen-Tanugi wrote:
>
>> Pauli, isn't it hopeless to follow the execution of the source code when
>> the crash actually occurs when I exit, and not when I execute. I would
>> have to understand enough of thi
On Wed, Mar 10, 2010 at 10:19 AM, Warren Weckesser
wrote:
> Warren Weckesser wrote:
>> Jerome Esteve wrote:
>>
>>> Dear all,
>>>
>>> Is there a way to give an integer value to j when using a[i:j:-1] so
>>> that the first element of the array can be included in the slice ?
>>>
>>> I would like to u
Warren Weckesser wrote:
> Jerome Esteve wrote:
>
>> Dear all,
>>
>> Is there a way to give an integer value to j when using a[i:j:-1] so
>> that the first element of the array can be included in the slice ?
>>
>> I would like to use some code like a[i:i-k:-1] to get a slice of
>> length k.
>>
On 03/10/2010 08:40 AM, Johann Cohen-Tanugi wrote:
> Pauli, isn't it hopeless to follow the execution of the source code when
> the crash actually occurs when I exit, and not when I execute. I would
> have to understand enough of this umath_tests.c.src to spot a refcount
> error or things like that
Wed, 10 Mar 2010 15:40:04 +0100, Johann Cohen-Tanugi wrote:
> Pauli, isn't it hopeless to follow the execution of the source code when
> the crash actually occurs when I exit, and not when I execute. I would
> have to understand enough of this umath_tests.c.src to spot a refcount
> error or things
Jerome Esteve wrote:
> Dear all,
>
> Is there a way to give an integer value to j when using a[i:j:-1] so
> that the first element of the array can be included in the slice ?
>
> I would like to use some code like a[i:i-k:-1] to get a slice of
> length k.
>
> The numpy documentation seems to sug
Pauli, isn't it hopeless to follow the execution of the source code when
the crash actually occurs when I exit, and not when I execute. I would
have to understand enough of this umath_tests.c.src to spot a refcount
error or things like that
On 03/10/2010 03:11 PM, Pauli Virtanen wrote:
> We
http://projects.scipy.org/numpy/ticket/1425 for the bug trac
well, I do feel challenged now... ;)
J
On 03/10/2010 03:11 PM, Pauli Virtanen wrote:
> Wed, 10 Mar 2010 10:28:07 +0100, Johann Cohen-Tanugi wrote:
>
>
>> On 03/10/2010 01:55 AM, Pauli Virtanen wrote:
>>
more fun :
[c
Wed, 10 Mar 2010 10:28:07 +0100, Johann Cohen-Tanugi wrote:
> On 03/10/2010 01:55 AM, Pauli Virtanen wrote:
>>> more fun :
>>> [co...@jarrett tests]$ pwd
>>> /home/cohen/sources/python/numpy/numpy/core/tests [co...@jarrett
>>> tests]$ python -c 'import test_ufunc' python: Modules/gcmodule.c:277:
>
On 10/03/10 10:09, Bruce Schultz wrote:
> On Sat, Mar 6, 2010 at 8:35 AM, Gökhan Sever wrote:
>
>> On Fri, Mar 5, 2010 at 8:00 AM, Bruce Schultz
>> wrote:
>>
>>> Output is:
>>> ### ndarray
>>> [[ 1. 2. ]
>>> [ 3. 4.1]]
>>> ### structured array
>>> [(1.0, 2.0) (3.0, 4.09
Hi,
First, excuse me if I am over-optimizing, but I am curious if there exist a way
to apply a function to an ndarray over a given dimension. In case I don't make
myself clear, I have an array of shape( n,2,2) where each row represents a 2 by
2 covariance matrix, and I want to perform the eigenvalu
Dear all,
Is there a way to give an integer value to j when using a[i:j:-1] so that the
first element of the array can be included in the slice ?
I would like to use some code like a[i:i-k:-1] to get a slice of length k.
The numpy documentation seems to suggest that j=-1 should work:
"Assume
On 03/10/2010 01:55 AM, Pauli Virtanen wrote:
>> more fun :
>> [co...@jarrett tests]$ pwd
>> /home/cohen/sources/python/numpy/numpy/core/tests
>> [co...@jarrett tests]$ python -c 'import test_ufunc'
>> python: Modules/gcmodule.c:277: visit_decref: Assertion `gc->gc.gc_refs
>> != 0' failed.
>> Abo
Ubuntu has a much shorter cycle of updates than Fedora, indeed.
On 03/10/2010 06:27 AM, Charles R Harris wrote:
On Tue, Mar 9, 2010 at 5:52 PM, Johann Cohen-Tanugi
mailto:co...@lpta.in2p3.fr>> wrote:
more fun :
[co...@jarrett tests]$ pwd
/home/cohen/sources/python/numpy/numpy/co
19 matches
Mail list logo