> How about this hackish solution, for a quick non-looping fix?
>
> In [39]: a = np.array([1,2,3,4,np.nan,1,2,3,np.nan,3])
> idx = np.flatnonzero(np.isnan(a))
> a_ = a.copy()
> a_[idx] = 0
> np.add.reduceat(a_, np.hstack((0,idx)))
> Out[39]: array([ 10., 6., 3.])
>
Close, but not exactly what
On Tue, Oct 23, 2012 at 8:57 PM, Thouis (Ray) Jones wrote:
> On Tue, Oct 23, 2012 at 10:58 AM, David Cournapeau wrote:
>> I will look into making the NumPy trac read-only. It should not be too
>> complicated to extend Pauli's code to redirect the tickets part to
>> github issues.
>
> If you need
On 23 October 2012 13:11, Cera, Tim wrote:
> I have an array that is peppered throughout in random spots with 'nan'. I
> would like to use 'cumsum', but I want it to reset the accumulation to 0
> whenever a 'nan' is encountered. Is there a way to do this? Aside from a
> loop - which is what I a
On Tue, Oct 23, 2012 at 10:58 AM, David Cournapeau wrote:
> I will look into making the NumPy trac read-only. It should not be too
> complicated to extend Pauli's code to redirect the tickets part to
> github issues.
If you need the map of trac IDs to github IDs, I have code to grab that.
Ray
__
Hi,
Why not start conting from the end of the vector until you find a nan?
Your problem do not need to check the full vector.
Fred
On Tue, Oct 23, 2012 at 1:11 PM, Cera, Tim wrote:
> I have an array that is peppered throughout in random spots with 'nan'. I
> would like to use 'cumsum', but I w
There's nothing like that built into numpy, no. I guess you could use
reduceat to calculate the total for each span of non-nans and then replace
each nan with the negative of that value so that plain cumsum would work,
but a loop is going to be easier (and a loop in Cython will be faster).
-n
On 2
I have an array that is peppered throughout in random spots with 'nan'. I
would like to use 'cumsum', but I want it to reset the accumulation to 0
whenever a 'nan' is encountered. Is there a way to do this? Aside from a
loop - which is what I am going to setup here in a moment.
Kindest regards,
On Tue, Oct 23, 2012 at 5:13 PM, Travis Oliphant wrote:
>
> On Oct 23, 2012, at 9:58 AM, David Cournapeau wrote:
>
> > On Tue, Oct 23, 2012 at 5:05 AM, Thouis (Ray) Jones
> wrote:
> >> On Fri, Oct 19, 2012 at 9:34 PM, Thouis (Ray) Jones
> wrote:
> >>> On Fri, Oct 19, 2012 at 4:46 PM, Thouis (Ray
Thanks! I did not know about the project. Looking into it.
rahul
On Tue, Oct 23, 2012 at 11:41 AM, Frédéric Bastien wrote:
> Did you saw the gpu nd array project? We try to do something similar
> but only for the GPU.
>
> https://github.com/inducer/compyte/wiki
>
> Fred
>
> On Sun, Oct 21, 2012
On Tue, 2012-10-23 at 11:41 -0400, Frédéric Bastien wrote:
> Did you saw the gpu nd array project? We try to do something similar
> but only for the GPU.
>
Out of interest, is there a reason why the backend for Numpy could not
be written entirely in OpenCL?
Assuming of course all the relevant bac
Did you saw the gpu nd array project? We try to do something similar
but only for the GPU.
https://github.com/inducer/compyte/wiki
Fred
On Sun, Oct 21, 2012 at 2:57 PM, Rahul Garg wrote:
> Thanks! I need to add support for eig and inv (will do this week, at
> least for CPU) but other than that,
On Oct 23, 2012, at 9:58 AM, David Cournapeau wrote:
> On Tue, Oct 23, 2012 at 5:05 AM, Thouis (Ray) Jones wrote:
>> On Fri, Oct 19, 2012 at 9:34 PM, Thouis (Ray) Jones wrote:
>>> On Fri, Oct 19, 2012 at 4:46 PM, Thouis (Ray) Jones
>>> wrote:
On Fri, Oct 19, 2012 at 11:20 AM, Thouis (Ray
On Tue, Oct 23, 2012 at 5:05 AM, Thouis (Ray) Jones wrote:
> On Fri, Oct 19, 2012 at 9:34 PM, Thouis (Ray) Jones wrote:
>> On Fri, Oct 19, 2012 at 4:46 PM, Thouis (Ray) Jones wrote:
>>> On Fri, Oct 19, 2012 at 11:20 AM, Thouis (Ray) Jones
>>> wrote:
I started the import with the oldest 75
13 matches
Mail list logo