The numpy reference manual, array objects/indexing/advance indexing,
says:
Advanced indexing always returns a copy of the data (contrast with
basic slicing that returns a view).
If I run the following code:
import numpy as np
d=range[2]
x=np.arange(36).reshape(3,2,3,2)
y=x[:,d,:,d]
y+=1
p
On Wed, Feb 4, 2015 at 12:18 AM, Warren Weckesser <
warren.weckes...@gmail.com> wrote:
>
>
> On Tue, Feb 3, 2015 at 11:14 PM, Sturla Molden
> wrote:
>
>> Warren Weckesser wrote:
>>
>> > 0if x < 0
>> > heaviside(x) = 0.5 if x == 0
>> > 1if x >
On Tue, Feb 3, 2015 at 12:58 PM, Warren Weckesser <
warren.weckes...@gmail.com> wrote:
> I have an implementation of the Heaviside function as numpy ufunc. Is
> there any interest in adding this to numpy? The function is simply:
>
> 0if x < 0
> heaviside(x) = 0.5 if
On Tue, Feb 3, 2015 at 11:14 PM, Sturla Molden
wrote:
> Warren Weckesser wrote:
>
> > 0if x < 0
> > heaviside(x) = 0.5 if x == 0
> > 1if x > 0
> >
>
> This is not correct. The discrete form of the Heaviside step function has
> the value 1 for
> This is not correct. The discrete form of the Heaviside step function has
> the value 1 for x == 0.
>
Yeah, I was looking at it and wondering if I'd misremembered the
definition. Assuming you're implementing the discrete Heaviside function,
H[0] = 1 as Sturla notes.
___
Warren Weckesser wrote:
> 0if x < 0
> heaviside(x) = 0.5 if x == 0
> 1if x > 0
>
This is not correct. The discrete form of the Heaviside step function has
the value 1 for x == 0.
heaviside = lambda x : 1 - (x < 0).astype(int)
Sturla
___
On Tue Feb 03 2015 at 1:47:34 PM Jaime Fernández del Río <
jaime.f...@gmail.com> wrote:
> On Tue, Feb 3, 2015 at 8:59 AM, Sebastian Berg > wrote:
>
>> On Di, 2015-02-03 at 07:18 -0800, Jaime Fernández del Río wrote:
>> >
>>
>> >
>> >
>> >
>> > Do you have a concrete example of what a non (1, 1)
That seems useful to me.
On Tue, Feb 3, 2015 at 3:58 PM, Warren Weckesser wrote:
> I have an implementation of the Heaviside function as numpy ufunc. Is
> there any interest in adding this to numpy? The function is simply:
>
> 0if x < 0
> heaviside(x) = 0.5 if x =
I have an implementation of the Heaviside function as numpy ufunc. Is
there any interest in adding this to numpy? The function is simply:
0if x < 0
heaviside(x) = 0.5 if x == 0
1if x > 0
Warren
__
On Tue, Feb 3, 2015 at 8:59 AM, Sebastian Berg
wrote:
> On Di, 2015-02-03 at 07:18 -0800, Jaime Fernández del Río wrote:
> >
>
> >
> >
> >
> > Do you have a concrete example of what a non (1, 1) array that fails
> > with relaxed strides would look like?
> >
> >
> > If we used, as right now, the
Hi
I am helping out with a Python and Fortran project. Let me give you some
background:
* Fortran source:
C Bergstrom FCC
C User subroutine VUMAT
subroutine VUMAT(
C Read only -
* nblock, ndir, nshr, nstatev, nprops,
* stepTime, dt,
* props,
* density, st
On Di, 2015-02-03 at 07:18 -0800, Jaime Fernández del Río wrote:
>
>
>
>
> Do you have a concrete example of what a non (1, 1) array that fails
> with relaxed strides would look like?
>
>
> If we used, as right now, the array flags as a first choice point, and
> only if none is set t
On Tue, Feb 3, 2015 at 1:28 AM, Sebastian Berg
wrote:
> On Mo, 2015-02-02 at 06:25 -0800, Jaime Fernández del Río wrote:
> > On Sat, Jan 31, 2015 at 1:17 AM, Sebastian Berg
> > wrote:
> > On Fr, 2015-01-30 at 19:52 -0800, Jaime Fernández del Río
> > wrote:
> > > On Thu, J
On Mo, 2015-02-02 at 06:25 -0800, Jaime Fernández del Río wrote:
> On Sat, Jan 31, 2015 at 1:17 AM, Sebastian Berg
> wrote:
> On Fr, 2015-01-30 at 19:52 -0800, Jaime Fernández del Río
> wrote:
> > On Thu, Jan 29, 2015 at 8:57 AM, Nathaniel Smith
>
> > wrote
14 matches
Mail list logo