David,
On Thu, 10 Feb 2011 14:30:37 +0900, David wrote:
> Hi there,
>
> Following recent release of waf 1.6 and its adoption by the samba
> project, as well as my own work on integrating waf and bento, I have
> spent some time to build numpy with it. Although this is experimental,
> it should
> Ben's suggestion is identical to:
>
> A = numpy.tensordot(P, C, axes=(1, 0))
Yes, that does the trick! Thank, very good idea.
Since i've build atlas with threading support, in the computation
of the dot product all four cpus go to 100%, which makes it quite fast.
I'm starting to love numpy ar
Hi,
in npy3_compat.h, one function simple_capsule_dtor is defined as static
but non-inline. AFAIK, there is no reason not to put inline (if
supported by the compiler of course) for a static function defined in a
header. Unless I hear someone justify it, I will change it,
cheers,
David
___
Hi there,
Following recent release of waf 1.6 and its adoption by the samba
project, as well as my own work on integrating waf and bento, I have
spent some time to build numpy with it. Although this is experimental,
it should be possible for people to play with it:
https://github.com/cournape/
On Wed, 09 Feb 2011 15:07:01 -0800, Nathaniel Smith wrote:
> This can't possibly be right, can it? Or am I missing something? (It
> certainly doesn't seem to match any documentation that I can find)
>
np.issubdtype(int, bool)
> True
np.__version__
> '1.5.1'
Thanks. It's a bug in issubdt
On Wed, Feb 9, 2011 at 1:24 AM, Friedrich Romstedt
wrote:
> 2011/2/8 Alok Singhal :
>> In [6]: data2 = numpy.zeros((0, 5), 'd')
>> In [7]: mask2 = numpy.zeros(0, 'bool')
>> In [8]: data2[mask2]
>>
>> Traceback (most recent call last):
>>
Mark Bakker wrote:
> I recently needed a find_first function and searched the list.
> It has been discussed a few times before.
> And I haven't seen an elegant solution yet.
> Maybe we should file a feature request, as it would be awfully nice to have?
> Mark
>
>>
>> > Still, I wonder if numpy wo
This can't possibly be right, can it? Or am I missing something? (It
certainly doesn't seem to match any documentation that I can find)
>>> np.issubdtype(int, bool)
True
>>> np.__version__
'1.5.1'
-- Nathaniel
___
NumPy-Discussion mailing list
NumPy-Dis
I recently needed a find_first function and searched the list.
It has been discussed a few times before.
And I haven't seen an elegant solution yet.
Maybe we should file a feature request, as it would be awfully nice to have?
Mark
>
> > Still, I wonder if numpy would benefit from a 'find_first' fu
2011/2/9 Davide Lasagna :
> Hi,
>
> I want to compute the following dot product:
>
> P = np.array( [[ p11, p12 ], [p21, p22]] )
> C = np.array( [c1, c2] )
>
> a1 = p11*c1 + p12*c2
> a2 = p21*c1 + p22*c2
>
> P.shape = (n, n)
> C.shape = (n, m, l)
>
> and with a result as:
>
> A.shape = (n, m, l)
In
On Wed, Feb 9, 2011 at 1:18 PM, Zachary Pincus wrote:
>>
In a 1-d array, find the first point where all subsequent points
have values
less than a threshold.
>>
>> This doesn't imply monotonicity.
>> Suppose with have a sin curve, and I want to find the last trough. Or
>> a business
>
>>> In a 1-d array, find the first point where all subsequent points
>>> have values
>>> less than a threshold.
>
> This doesn't imply monotonicity.
> Suppose with have a sin curve, and I want to find the last trough. Or
> a business cycle and I want to find the last recession.
>
> Unless my en
On Tue, Feb 8, 2011 at 10:49 AM, Pauli Virtanen wrote:
> Tue, 08 Feb 2011 11:35:12 -0700, Charles R Harris wrote:
> > Permission to close ticket for Mark Wiebe
> >
> > I don't know who handles these permissions, I didn't see a way to do it
> > myself.
>
> Granted. (You'd need a shell account to d
On Wed, Feb 9, 2011 at 11:25 AM, Zachary Pincus wrote:
>>> This assumes monotonicity. Is that allowed?
>>
>> The twice-stated problem was:
>
> [Note to avert email-miscommunications] BTW, I wasn't trying to snipe
> at you with that comment, Josef...
>
> I just meant to say that this solution solve
On Wed, Feb 9, 2011 at 10:48, Neal Becker wrote:
> Still, I wonder if numpy would benefit from a 'find_first' function.
I certainly could have used one many times.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad
On Wed, Feb 9, 2011 at 9:53 AM, Davide Lasagna wrote:
> Hi,
>
> I want to compute the following dot product:
>
> P = np.array( [[ p11, p12 ], [p21, p22]] )
> C = np.array( [c1, c2] )
>
> where c1 and c2 are m*m matrices, so that
>
> C.shape = (2,m,m)
>
> I want to compute:
>
> A = np.array([a1, a2
On 2/9/2011 11:39 AM, Bruce Southey wrote:
> np.argmax(x>5) # doesn't appear to be correct
It was an answer to the particular question
of how to do find_first, which it does
(at the cost of a boolean array):
it finds the first element greater than 5.
>>> x
array([5, 4, 3, 6, 7, 3, 2, 1
Zachary Pincus wrote:
>
> On Feb 9, 2011, at 10:58 AM, Neal Becker wrote:
>
>> Zachary Pincus wrote:
>>
>> In a 1-d array, find the first point where all subsequent points
>> have values
>> less than a threshold, T.
>
> Maybe something like:
>
> last_greater = numpy.a
On 02/09/2011 10:17 AM, Zachary Pincus wrote:
>>> As before, the line below does what you said you need, though not
>>> maximally efficiently. (Try it in an interpreter...) There may be
>>> another way in numpy that doesn't rely on constructing the index
>>> array, but this is the first thing that
>> This assumes monotonicity. Is that allowed?
>
> The twice-stated problem was:
[Note to avert email-miscommunications] BTW, I wasn't trying to snipe
at you with that comment, Josef...
I just meant to say that this solution solves the problem as Neal
posed it, though that might not be the ex
>> As before, the line below does what you said you need, though not
>> maximally efficiently. (Try it in an interpreter...) There may be
>> another way in numpy that doesn't rely on constructing the index
>> array, but this is the first thing that came to mind.
>>
>> last_greater = numpy.arange(ar
On Wed, Feb 9, 2011 at 11:04 AM, Zachary Pincus wrote:
>
> On Feb 9, 2011, at 10:58 AM, Neal Becker wrote:
>
>> Zachary Pincus wrote:
>>
>> In a 1-d array, find the first point where all subsequent points
>> have values
>> less than a threshold, T.
>
> Maybe something like:
>>>
On 2/9/2011 10:58 AM, Neal Becker wrote:
> But where is numpy's 'find_first' function?
np.argmax(array>T)
(Of course that constructs a boolean array...)
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mail
On Feb 9, 2011, at 10:58 AM, Neal Becker wrote:
> Zachary Pincus wrote:
>
> In a 1-d array, find the first point where all subsequent points
> have values
> less than a threshold, T.
Maybe something like:
last_greater = numpy.arange(arr.shape)[arr >= T][-1]
fi
Zachary Pincus wrote:
In a 1-d array, find the first point where all subsequent points
have values
less than a threshold, T.
>>>
>>> Maybe something like:
>>>
>>> last_greater = numpy.arange(arr.shape)[arr >= T][-1]
>>> first_lower = last_greater + 1
>>>
>>> There's probably a bette
Hi,
I want to compute the following dot product:
P = np.array( [[ p11, p12 ], [p21, p22]] )
C = np.array( [c1, c2] )
where c1 and c2 are m*m matrices, so that
C.shape = (2,m,m)
I want to compute:
A = np.array([a1, a2])
where a1 and a2 are two matrices m*m, from the dot product of P and C.
>>> In a 1-d array, find the first point where all subsequent points
>>> have values
>>> less than a threshold, T.
>>
>> Maybe something like:
>>
>> last_greater = numpy.arange(arr.shape)[arr >= T][-1]
>> first_lower = last_greater + 1
>>
>> There's probably a better way to do it, without the arang
Zachary Pincus wrote:
>> In a 1-d array, find the first point where all subsequent points
>> have values
>> less than a threshold, T.
>
> Maybe something like:
>
> last_greater = numpy.arange(arr.shape)[arr >= T][-1]
> first_lower = last_greater + 1
>
> There's probably a better way to do it, w
> In a 1-d array, find the first point where all subsequent points
> have values
> less than a threshold, T.
Maybe something like:
last_greater = numpy.arange(arr.shape)[arr >= T][-1]
first_lower = last_greater + 1
There's probably a better way to do it, without the arange, though...
__
In a 1-d array, find the first point where all subsequent points have values
less than a threshold, T.
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
2011/2/9 Mark Bakker :
> a = array([1,2,3])
>
> I want to take the last two terms and make it a column vector:
>
> a[[1,2],newaxis]
> a[[1,2]][:,newaxis]
The former is advanced indexing, while the latter is basic slicing
(after advanced indexing). See
http://docs.scipy.org/doc/numpy/reference/arr
Hello List,
I have a simple array
a = array([1,2,3])
I want to take the last two terms and make it a column vector:
a[[1,2],newaxis]
But I get a funny error: TypeError: long() argument must be a string or a
number, not 'NoneType'
It does work if I do
a[[1,2]][:,newaxis]
But I don't understa
Hi,
2011/2/8 Alok Singhal :
> Hi,
>
> I have an NxM array, which I am indexing with a 1-d, length N boolean
> array. For example, with a 3x5 array:
>
> In [1]: import numpy
> In [2]: data = numpy.arange(15)
> In [3]: data.shape = 3, 5
>
> Now, I want to select rows 0 and 2, so I can do:
>
> In [4
33 matches
Mail list logo