Timothy Hochberg wrote:
> On 4/23/07, Duncan Smith <[EMAIL PROTECTED]> wrote:
>
>>
>> Hello,
>> Since moving to numpy I've had a few problems with my existing
>> code. It basically revolves around the numpy scalar types. e.g.
>>
>>
>>
>> >>>
On Tue, 24 Apr 2007, Timothy Hochberg apparently wrote:
> Personally I'd opt for completely following Python here,
> with the C-like integer division and mod operators
> available as appropriately named ufuncs somewhere. It's
> a backwards incompatible change though, so it'd have to
> wait til
On Apr 23, 2007, at 21:35 , David M. Cooke wrote:
Python defines x // y as returning the floor of the division, and x
% y has the same sign as y. However, in C89, it is implementation-
defined (i.e., portability-pain-in-the-ass) whether the floor or
ceil is used when the signs of x and y di
>
> Personally I'd opt for completely following Python here, with the
> C-like integer division and mod operators available as appropriately
> named ufuncs somewhere. It's a backwards incompatible change though,
> so it'd have to wait till at least a minor realease.
I'm supportive of follow
On Tue, 24 Apr 2007, Timothy Hochberg wrote:
> On 4/24/07, Robert Kern <[EMAIL PROTECTED]> wrote:
> >
> > Christian Marquardt wrote:
>
>
>
> > > Restore the invariant, and follow python.
>
>
> This seems to imply that once upon a time numpy/numeric/numarray followed
> python here, but as far as
On Tue, April 24, 2007 23:31, Christian Marquardt wrote:
> On Tue, April 24, 2007 23:08, Robert Kern wrote:
>> Christian Marquardt wrote:
>>> Restore the invariant, and follow python.
>>>
>>> This
>>>
>>>>>> -5 // 6
>>>-1
>>>
>>> and
>>>
>>>>>> array([-5])[0] // 6
>>>0
>>>
>>> simpl
On 4/24/07, Robert Kern <[EMAIL PROTECTED]> wrote:
Christian Marquardt wrote:
> Restore the invariant, and follow python.
This seems to imply that once upon a time numpy/numeric/numarray followed
python here, but as far as I can recall that was never the case. Instead
they followed C com
On Tue, April 24, 2007 23:08, Robert Kern wrote:
> Christian Marquardt wrote:
>> Restore the invariant, and follow python.
>>
>> This
>>
>>>>> -5 // 6
>>-1
>>
>> and
>>
>>>>> array([-5])[0] // 6
>>0
>>
>> simply doesn't make sense - in any language, you would expect that
>> all basi
Christian Marquardt wrote:
> Restore the invariant, and follow python.
>
> This
>
>>>> -5 // 6
>-1
>
> and
>
>>>> array([-5])[0] // 6
>0
>
> simply doesn't make sense - in any language, you would expect that
> all basic operators provide you with the same same answer when
> app
Restore the invariant, and follow python.
This
>>> -5 // 6
-1
and
>>> array([-5])[0] // 6
0
simply doesn't make sense - in any language, you would expect that
all basic operators provide you with the same same answer when
applied to the same number, no?
Christian.
On Tue, Apri
Do restore the invariant.
Behave completely like Python if not too costly,
otherwise follow C89.
A user's view,
Alan Isaac
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
On Apr 23, 2007, at 22:04 , Warren Focke wrote:
But even C89 required that x == (x/y)*y + (x%y), and that's not the
case
here.
Missed that. You're right. We pull the same trick Python does with %
so that the sign of x % y agrees with the sign of y, but we don't
follow Python in guarantee
On 4/24/07, Timothy Hochberg <[EMAIL PROTECTED]> wrote
[CHOP]
Sorry, cut and paste error, that should have read:
:
>
> >>> i = a[0,0]
> >>> 1/i
>
> 0
You should be getting a warning here. Did one disappear in the cut and
paste? Or are you using a nonstandard shell that eats warnings? Or an
On 4/23/07, Duncan Smith <[EMAIL PROTECTED]> wrote:
Hello,
Since moving to numpy I've had a few problems with my existing
code. It basically revolves around the numpy scalar types. e.g.
>>> import Numeric as N
>>> a = N.array([[0,1],[2,3]]
Christopher Barker wrote:
> Bill Baxter wrote:
>>> In [35]: x = [ 0, 0, 0, 99, 0, 1, 5]
>>> In [37]: i=nonzero(x)
>>> In [38]: i
>>> Out[38]: (array([3, 5, 6]),)
>
>> Just do i[0]. It's an array, not a string. Try typing "type(i[0])"
>> and see what it tells you.
>
> Which still begs the questi
On 4/20/07, Per B. Sederberg <[EMAIL PROTECTED]> wrote:
Hi Folks:
I'm getting a very strange bus error in the recent versions of numpy
(almost current svn). Here's how you can (hopefully) replicate it:
On my MacBook:
Python 2.4.3 (#1, Apr 7 2006, 10:54:33)
[GCC 4.0.1 (Apple Computer, Inc. b
Bill Baxter wrote:
>> In [35]: x = [ 0, 0, 0, 99, 0, 1, 5]
>> In [37]: i=nonzero(x)
>> In [38]: i
>> Out[38]: (array([3, 5, 6]),)
> Just do i[0]. It's an array, not a string. Try typing "type(i[0])"
> and see what it tells you.
Which still begs the question: why does nonzero() return a tuple wi
On 4/21/07, Dennis Cooke <[EMAIL PROTECTED]> wrote:
> I'm an ex-Matlab user trying to come up to speed with python and numpy.
Howdy. First, I hope you've checked out the page:
http://www.scipy.org/NumPy_for_Matlab_Users
> I'm
> confused on how to use the Numpy functions nonzero() and where().
On 4/20/07, Dennis Cooke <[EMAIL PROTECTED]> wrote:
I'm an ex-Matlab user trying to come up to speed with python and numpy.
I'm confused on how to use the Numpy functions nonzero() and where(). In
matlab, the equivalent function (find(a>0) ) would return an array, whereas
in numpy, where() or n
Easy!
a[b==i]
--bb
On 4/24/07, Tommy Grav <[EMAIL PROTECTED]> wrote:
> I have two arrays:
>
> a = numpy.array([0,1,2,3,4,5,6,7,8,9])
> b = numpy.array([0,0,1,1,2,2,0,1,2,3])
>
> I would like to get the part of a that corresponds
> to where b is equal to i.
>
> For example:
>
> i = 0 => ([0,1,6])
Hello,
Since moving to numpy I've had a few problems with my existing
code. It basically revolves around the numpy scalar types. e.g.
>>> import Numeric as N
>>> a = N.array([[0,1],[2,3]])
>>> a
array([[0, 1],
[2, 3]])
>>> i = a[0,0]
I have two arrays:
a = numpy.array([0,1,2,3,4,5,6,7,8,9])
b = numpy.array([0,0,1,1,2,2,0,1,2,3])
I would like to get the part of a that corresponds
to where b is equal to i.
For example:
i = 0 => ([0,1,6])
i = 1 => ([2,3,7])
Cheers
Tommy
___
Nump
I'm an ex-Matlab user trying to come up to speed with python and numpy. I'm
confused on how to use the Numpy functions nonzero() and where(). In
matlab, the equivalent function (find(a>0) ) would return an array, whereas
in numpy, where() or nonzero() will return a single element tuple. For
exa
Hi Folks:
I'm getting a very strange bus error in the recent versions of numpy
(almost current svn). Here's how you can (hopefully) replicate it:
On my MacBook:
Python 2.4.3 (#1, Apr 7 2006, 10:54:33)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" o
Hi Mark
On Tue, Apr 24, 2007 at 07:28:35AM -, mark wrote:
> I have a piece of code that works fine for me, but a friend tries to
> run it and gets this warning.
> He claims to have updated his Python (2.4), Scipy and numpy. A
> Does anybody know what import triggers this Warning? I didn't thin
Hello All -
I have a piece of code that works fine for me, but a friend tries to
run it and gets this warning.
He claims to have updated his Python (2.4), Scipy and numpy. A
Does anybody know what import triggers this Warning? I didn't think I
imported ScipyTest.
Thanks, Mark
Warning (from warni
26 matches
Mail list logo