Re: [Numpy-discussion] Please test the SVN branch

2006-10-11 Thread Nils Wagner
Travis Oliphant wrote: > I made some fixes to the "asbuffer" code which let me feel better about > exposing it in NumPy (where it is now named int_asbuffer). > > This code takes a Python integer and a size and returns a buffer object > that points to that memory. A little test is performed by tr

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Fernando Perez
On 10/12/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > Why in the world does it scare you away. This makes no sense to me. > If you don't like the scipy version don't use it. NumPy and SciPy are > not the same thing. I'd like to pitch in (again) on this issue, but I'll try to make sure that

Re: [Numpy-discussion] incrementing along a diagonal

2006-10-11 Thread Johannes Loehnert
Hi, I absolutely do not know perl, so I do not know what the expression you posted does. However, the key is just to understand indexing in numpy: if you have a matrix mat and index arrays index1, index2 with, lets say, index1 = array([ 17, 19, 29]) index2 = array([ 12, 3, 9]) then the entri

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Travis Oliphant
David Goldsmith wrote: > Travis Oliphant wrote: > >> What could be simpler? ;-) >> > Having sqrt(-1) return 1j (without having to remember that in order to > get this, you have to write sqrt(-1+0j) instead). > > That's exactly what scipy.sqrt(-1) does. That was my point. -Travis ---

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread David Goldsmith
Stefan van der Walt wrote: >> This is one reason that NumPy by itself is not a MATLAB >> replacement. >> > Intuitive usage is hopefully not a MATLAB-only feature. > Here, here! (Or is it Hear, hear! I don't think I've ever seen it written out before. :-) ) > I'll shut up now :) But why

[Numpy-discussion] Please test the SVN branch

2006-10-11 Thread Travis Oliphant
I made some fixes to the "asbuffer" code which let me feel better about exposing it in NumPy (where it is now named int_asbuffer). This code takes a Python integer and a size and returns a buffer object that points to that memory. A little test is performed by trying to read (and possibly wri

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread David Cournapeau
David Goldsmith wrote: > Travis Oliphant wrote: > >> What could be simpler? ;-) >> > Having sqrt(-1) return 1j (without having to remember that in order to > get this, you have to write sqrt(-1+0j) instead). > > But this can sometimes lead to confusing errors hard to track when you don

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread David Goldsmith
Travis Oliphant wrote: > > This is the one that concerns me. Slowing everybody down who knows they > have positive values just for people that don't seems problematic. > > Then have a "sqrtp" function for those users who are fortunate enough to know ahead of time that they'll only be talking

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread David Goldsmith
Travis Oliphant wrote: > What could be simpler? ;-) Having sqrt(-1) return 1j (without having to remember that in order to get this, you have to write sqrt(-1+0j) instead). DG - Using Tomcat but need to do more? Need to sup

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Travis Oliphant
David Goldsmith wrote: > Travis Oliphant wrote: > >> [EMAIL PROTECTED] wrote: >> >> >> >>> Could sqrt(-1) made to return 1j again? >>> >>> >>> >> Not in NumPy. But, in scipy it could. >> >> >> > Ohmigod!!! You are definitely going to scare away many, many potential

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread David Goldsmith
Sven Schreiber wrote: > Travis Oliphant schrieb: > > >>> If not, shouldn't >>> >>> >>> numpy.sqrt(-1) raise a ValueError instead of returning silently nan? >>> >>> >>> >> This is user adjustable. You change the error mode to raise on >> 'invalid' instead of pass silently which is no

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread David Goldsmith
Travis Oliphant wrote: > [EMAIL PROTECTED] wrote: > > >> Could sqrt(-1) made to return 1j again? >> >> > Not in NumPy. But, in scipy it could. > > Ohmigod!!! You are definitely going to scare away many, many potential users - if I wasn't obliged to use open source at work, you'd be s

Re: [Numpy-discussion] round

2006-10-11 Thread David Goldsmith
Charles R Harris wrote: > > > On 10/11/06, *Greg Willden* <[EMAIL PROTECTED] > > wrote: > > Hi All, > > I've read discussions in the archives about how round() "rounds to > even" and how that is supposedly better. > > But what I haven't been able to find i

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Charles R Harris
On 10/11/06, Tim Hochberg <[EMAIL PROTECTED]> wrote: Greg Willden wrote:> On 10/11/06, *Travis Oliphant* <[EMAIL PROTECTED]> [EMAIL PROTECTED]>> wrote: >> Stefan van der Walt wrote:> >Further, if I understand correctly, changing sqrt and power to give> >the right answer by default will

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Tim Hochberg
Greg Willden wrote: > On 10/11/06, *Travis Oliphant* <[EMAIL PROTECTED] > > wrote: > > Stefan van der Walt wrote: > >Further, if I understand correctly, changing sqrt and power to give > >the right answer by default will slow things down somewhat. But > i

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Travis Oliphant
Greg Willden wrote: > On 10/11/06, *Travis Oliphant* <[EMAIL PROTECTED] > > wrote: > > Stefan van der Walt wrote: > >Further, if I understand correctly, changing sqrt and power to give > >the right answer by default will slow things down somewhat. But > i

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Bill Baxter
On 10/12/06, Greg Willden <[EMAIL PROTECTED]> wrote: > On 10/11/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > > Stefan van der Walt wrote: > > >Further, if I understand correctly, changing sqrt and power to give > > >the right answer by default will slow things down somewhat. But is it > > >wor

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Greg Willden
On 10/11/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: Stefan van der Walt wrote:>Further, if I understand correctly, changing sqrt and power to give>the right answer by default will slow things down somewhat.  But is it>worth sacrificing intuitive usage for speed? >For NumPy, yes.This is one reas

Re: [Numpy-discussion] incrementing along a diagonal

2006-10-11 Thread Travis Oliphant
David Novakovic wrote: > Hi, > > i'm moving some old perl PDL code to python. I've come across a line > which changes values in a diagonal line accross a matrix. > > matrix.diagonal() returns a list of values, but making changes to these > does not reflect in the original (naturally). > > I'm just

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Tim Hochberg
Travis Oliphant wrote: > Tim Hochberg wrote: > > >> With python 2.5 out now, perhaps it's time to come up with a with >> statement context manager. Something like: >> >>from __future__ import with_statement >>import numpy >> >>class errstate(object): >>def __init__(self, **k

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Paul Dubois
This is a meta-statement about this argument.We already had it. Repeatedly. Whether you choose it one way or the other, for Numeric the community chose it the way it did for a reason. It is a good reason. It isn't stupid. There were good reasons for the other way. Those reasons weren't stupid. It w

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Stefan van der Walt
On Wed, Oct 11, 2006 at 08:24:01PM -0400, A. M. Archibald wrote: > What is the desired behaviour of sqrt? [...] > Should it return a complex array only when any entry in its input is > negative? This will be even *more* surprising when a negative (perhaps > even -0) value appears in their matrix

Re: [Numpy-discussion] SPAM-LOW: Re: incrementing along a diagonal

2006-10-11 Thread David Novakovic
David Novakovic wrote: > Thanks for the help, i've learnt a lot and also figured out something > that does what I want, i'll paste an interactive session below: > > x = zeros((4,7)) > x > array([[0, 0, 0, 0, 0, 0, 0], >[0, 0, 0, 0, 0, 0, 0], >[0, 0, 0, 0, 0, 0, 0], >[0,

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread A. M. Archibald
On 11/10/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > """ > In SciPy 0.3.x the ufuncs were overloaded by more "intelligent" versions. > A very attractive feature was that sqrt(-1) would yield 1j as in Matlab. > Then you can program formulas directly (e.g., roots of a 2nd order > polynomial)

Re: [Numpy-discussion] incrementing along a diagonal

2006-10-11 Thread David Novakovic
Thanks for the help, i've learnt a lot and also figured out something that does what I want, i'll paste an interactive session below: x = zeros((4,7)) x array([[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]]) index = arange(min(

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Stefan van der Walt
On Wed, Oct 11, 2006 at 05:21:44PM -0600, Travis Oliphant wrote: > Stefan van der Walt wrote: > > >I agree with Fernando on this one. > > > >Further, if I understand correctly, changing sqrt and power to give > >the right answer by default will slow things down somewhat. But is it > >worth sacrif

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Pierre GM
> >nan's are making things really slow, > > Yeah, they do. This actually makes the case for masked arrays, rather > than using NAN's. Travis, Talking about masked arrays, I'm about being done rewriting numpy.core.ma, mainly transforming MaskedArray as a subclass of ndarray (it should be OK by

Re: [Numpy-discussion] incrementing along a diagonal

2006-10-11 Thread Bill Baxter
On 10/12/06, David Novakovic <[EMAIL PROTECTED]> wrote: > Johannes Loehnert wrote: > This is very nice, exactly what i want, but it doesnt work for mxn > matricies: > > >>> x = zeros((5,3)) > >>> x > array([[0, 0, 0], >[0, 0, 0], >[0, 0, 0], >[0, 0, 0], >[0, 0, 0]])

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Travis Oliphant
Tim Hochberg wrote: >With python 2.5 out now, perhaps it's time to come up with a with >statement context manager. Something like: > >from __future__ import with_statement >import numpy > >class errstate(object): >def __init__(self, **kwargs): >self.kwargs = kwargs

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread pearu
On Wed, 11 Oct 2006, Travis Oliphant wrote: > >Interestingly, in worst cases numpy.sqrt is approximately ~3 times slower > >than scipy.sqrt on negative input but ~2 times faster on positive input: > > > >In [47]: pos_input = numpy.arange(1,100,0.001) > > > >In [48]: %timeit -n 1000 b=numpy.sqrt(p

Re: [Numpy-discussion] incrementing along a diagonal

2006-10-11 Thread David Novakovic
Johannes Loehnert wrote: >> I'm just wondering if there is a way that i can increment all the values >> along a diagonal? >> > > Assume you want to change mat. > > # min() only necessary for non-square matrices > index = arange(min(mat.shape[0], mat.shape[1])) > # add 1 to each diagonal elemen

[Numpy-discussion] RC2 - f2py no workee

2006-10-11 Thread Mathew Yeates
I'm running the following python c:\Python24\Scripts\f2py.py --fcompiler=absoft -c foo.pyf foo.f and it seems that the compiler info isn't being passed down. When distutils tries to compile I get the error --- File "C:\Python24\Lib\site-packag

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Travis Oliphant
[EMAIL PROTECTED] wrote: > >On Wed, 11 Oct 2006, Travis Oliphant wrote: > > > >>On the other hand requiring all calls to numpy.sqrt to go through an >>"argument-checking" wrapper is a bad idea as it will slow down other uses. >> >> > >Interestingly, in worst cases numpy.sqrt is approximatel

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Travis Oliphant
Stefan van der Walt wrote: >I agree with Fernando on this one. > >Further, if I understand correctly, changing sqrt and power to give >the right answer by default will slow things down somewhat. But is it >worth sacrificing intuitive usage for speed? > > For NumPy, yes. This is one reason tha

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread pearu
On Wed, 11 Oct 2006, Travis Oliphant wrote: > On the other hand requiring all calls to numpy.sqrt to go through an > "argument-checking" wrapper is a bad idea as it will slow down other uses. Interestingly, in worst cases numpy.sqrt is approximately ~3 times slower than scipy.sqrt on negative

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Stefan van der Walt
On Wed, Oct 11, 2006 at 03:37:34PM -0600, Fernando Perez wrote: > On 10/11/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > > > [EMAIL PROTECTED] wrote: > > >Could sqrt(-1) made to return 1j again? > > > > > Not in NumPy. But, in scipy it could. > > Without taking sides on which way to go, I'd l

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Fernando Perez
On 10/11/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > Fernando Perez wrote: > >There are people who import scipy for everything, others distinguish > >between numpy and scipy, others use numpy alone and at some point in > >their life's code they do > > > >import numpy as N -> import scipy as N

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Fernando Perez
On 10/11/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > Fernando Perez wrote: > >IMHO, scipy should be within reason a strict superset of numpy. > > > > > This was not the relationship of scipy to Numeric. > > For me, it's the fact that scipy *used* to have the behavior that > > scipy.sqrt(-1) r

Re: [Numpy-discussion] Things to address for Py3K

2006-10-11 Thread Eric Firing
Charles R Harris wrote: [...] >b) extending 'and' and 'or' to allow element-by-element logical > operations or adding && and || > > 2) Lowering the precedence of & so that a > 8 & a < 10 works as you > would expect. > > > Yes on the extra operators. No on changing the preced

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Tim Hochberg
Travis Oliphant wrote: > Sven Schreiber wrote: > > >>> This is user adjustable. You change the error mode to raise on >>> 'invalid' instead of pass silently which is now the default. >>> >>> -Travis >>> >>> >>> >>> >> Could you please explain how this adjustment is done, or point to

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Travis Oliphant
Fernando Perez wrote: >On 10/11/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > > > >>[EMAIL PROTECTED] wrote: >> >> >>>Could sqrt(-1) made to return 1j again? >>> >>> >>> >>Not in NumPy. But, in scipy it could. >> >> > >Without taking sides on which way to go, I'd like to -1 the

Re: [Numpy-discussion] Things to address for Py3K

2006-10-11 Thread Christopher Barker
A. M. Archibald wrote: > IEEE floats in python proper +1 -CHB -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main

Re: [Numpy-discussion] Things to address for Py3K

2006-10-11 Thread A. M. Archibald
On 11/10/06, Charles R Harris <[EMAIL PROTECTED]> wrote: > Speaking long term, what about data types? The basic 80 bit extended > precision float now occurs in 80, 96, and 128 bit versions depending on > alignment. So what happens when quad precision, which will probably be in > the next IEEE stan

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Fernando Perez
On 10/11/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > >Could sqrt(-1) made to return 1j again? > > > Not in NumPy. But, in scipy it could. Without taking sides on which way to go, I'd like to -1 the idea of a difference in behavior between numpy and scipy. IMHO, s

Re: [Numpy-discussion] Things to address for Py3K

2006-10-11 Thread Christopher Barker
Travis Oliphant wrote: >> 3) Inclusion of an nd-array type in the standard lib! >> (or at the very least, an nd-array protocol) >> > Work on an nd-array protocol to extend the buffer protocol is occurring > right now. It think this will be better in the end then a standard > nd-array type. Wel

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Travis Oliphant
Sven Schreiber wrote: >>This is user adjustable. You change the error mode to raise on >>'invalid' instead of pass silently which is now the default. >> >>-Travis >> >> >> > >Could you please explain how this adjustment is done, or point to the >relevant documentation. > > numpy.sqrt(-1)

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Sven Schreiber
Travis Oliphant schrieb: > >> If not, shouldn't >> >> >> numpy.sqrt(-1) raise a ValueError instead of returning silently nan? >> >> > This is user adjustable. You change the error mode to raise on > 'invalid' instead of pass silently which is now the default. > > -Travis > Could you plea

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Travis Oliphant
[EMAIL PROTECTED] wrote: >Hi, > >I have recieved the following note from a user: > >""" >In SciPy 0.3.x the ufuncs were overloaded by more "intelligent" versions. >A very attractive feature was that sqrt(-1) would yield 1j as in Matlab. >Then you can program formulas directly (e.g., roots of a 2nd

Re: [Numpy-discussion] round

2006-10-11 Thread Bill Baxter
Hmm. I learned "round to even" in school... But another formula that should get you what you want is: floor(x + 0.5).astype(int) --bb On 10/12/06, Greg Willden <[EMAIL PROTECTED]> wrote: > Hi All, > > I've read discussions in the archives about how round() "rounds to even" and > how that is s

Re: [Numpy-discussion] round

2006-10-11 Thread Greg Willden
On 10/11/06, Charles R Harris <[EMAIL PROTECTED]> wrote: Perhaps you could explain *why* you want the schoolbook round? Given that floating point is inherently inaccurate you would have to expect to produce a lot of numbers exactly of the form x.5 *without errors*, which means you probably don't ne

[Numpy-discussion] Library problem on installation

2006-10-11 Thread Michael Subotin
Hi, I know that it's a perennial topic on the list, but I haven't been able to find my answer in the archives. After running the installation on a RedHat Linux machine, I'm getting the import error: "/usr/lib/libblas.so.3: undefined symbol: e_wsfe". Judging from earlier exchanges here, it seems th

Re: [Numpy-discussion] round

2006-10-11 Thread Charles R Harris
On 10/11/06, Greg Willden <[EMAIL PROTECTED]> wrote: Hi All,I've read discussions in the archives about how round() "rounds to even" and how that is supposedly better.But what I haven't been able to find is "What do I use if I want the regular old round that you learn in school?" Perhaps you could

[Numpy-discussion] round

2006-10-11 Thread Greg Willden
Hi All,I've read discussions in the archives about how round() "rounds to even" and how that is supposedly better.But what I haven't been able to find is "What do I use if I want the regular old round that you learn in school?" Sorry for the likely FAQ.Greg-- Linux.  Because rebooting is for adding

[Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread pearu
Hi, I have recieved the following note from a user: """ In SciPy 0.3.x the ufuncs were overloaded by more "intelligent" versions. A very attractive feature was that sqrt(-1) would yield 1j as in Matlab. Then you can program formulas directly (e.g., roots of a 2nd order polynomial) and the right

[Numpy-discussion] sheet wizard create truly

2006-10-11 Thread Our Partners
Here log in you are raquo Magazine Home Todays Compact din Rail.Just anything in several skins choose between own style Creating takes few seconds click get.Create truly unique layout Change every of image Template system Thread a count Total.Modules Devices Embedded Systems Displays Packagi

Re: [Numpy-discussion] Things to address for Py3K

2006-10-11 Thread Charles R Harris
On 10/11/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: Hi all,Py3K is undergoing active development.  This gives us an opportunity todiscuss more significant changes to the language that might improve theexperience of NumPy users.We should form a list and start commenting on the py3k mailing lists

Re: [Numpy-discussion] Things to address for Py3K

2006-10-11 Thread Travis Oliphant
Christopher Barker wrote: >Travis Oliphant wrote: > > >>A couple on my short list >> >>1) Adding a *few* new infix operators. >> >> a) an extra multiplication operator to distinguish between >>element-by-element and dot >> b) extending 'and' and 'or' to allow element-by-element logical >>o

Re: [Numpy-discussion] Things to address for Py3K

2006-10-11 Thread Christopher Barker
Travis Oliphant wrote: > A couple on my short list > > 1) Adding a *few* new infix operators. > >a) an extra multiplication operator to distinguish between > element-by-element and dot >b) extending 'and' and 'or' to allow element-by-element logical > operations or adding && and || > >

[Numpy-discussion] Things to address for Py3K

2006-10-11 Thread Travis Oliphant
Hi all, Py3K is undergoing active development. This gives us an opportunity to discuss more significant changes to the language that might improve the experience of NumPy users. We should form a list and start commenting on the py3k mailing lists about what changes would be most helpful fo

Re: [Numpy-discussion] select part of array using two conditions

2006-10-11 Thread Bill Baxter
On 10/11/06, Nils Wagner <[EMAIL PROTECTED]> wrote: > Mark Bakker wrote: > > Hello - > > > > I want to select part of an array using two conditions. > > I know how to do it with one condition (and it works great), but when > > I use two conditions I get an error message? > > This is probably easy,

Re: [Numpy-discussion] cannot import Numeric

2006-10-11 Thread Carl Wenrich
thanks.Travis Oliphant <[EMAIL PROTECTED]> wrote: Carl Wenrich wrote:> thanks, but actually it's the other applications i want to use that > have the 'import Numeric' line in them. i'm sure others have noted > this before. what's the normal procedure?You must install Numeric if a package needs Nume

Re: [Numpy-discussion] cannot import Numeric

2006-10-11 Thread Travis Oliphant
Carl Wenrich wrote: > thanks, but actually it's the other applications i want to use that > have the 'import Numeric' line in them. i'm sure others have noted > this before. what's the normal procedure? You must install Numeric if a package needs Numeric. As far as Python is concerned NumPy

Re: [Numpy-discussion] asmatrix and asarray exception

2006-10-11 Thread Travis Oliphant
Charles R Harris wrote: > > > On 10/11/06, *Keith Goodman* <[EMAIL PROTECTED] > > wrote: > > On 10/11/06, Keith Goodman <[EMAIL PROTECTED] > > wrote: > > This works: > > > > >> M.asmatrix(['a', 'b', None]) > > matrix([[a,

Re: [Numpy-discussion] cannot import Numeric

2006-10-11 Thread Carl Wenrich
thanks, but actually it's the other applications i want to use that have the 'import Numeric' line in them. i'm sure others have noted this before. what's the normal procedure?Darren Dale <[EMAIL PROTECTED]> wrote: On Wednesday 11 October 2006 12:48, Carl Wenrich wrote:> The installation of Numpy w

Re: [Numpy-discussion] asmatrix and asarray exception

2006-10-11 Thread Charles R Harris
On 10/11/06, Keith Goodman <[EMAIL PROTECTED]> wrote: On 10/11/06, Keith Goodman <[EMAIL PROTECTED]> wrote:> This works:>> >> M.asmatrix(['a', 'b', None])> matrix([[a, b, None]], dtype=object) >> But this doesn't:>> >> M.asmatrix(['a', 'b', None, 'c'])> TypeError: expected a readable buffer object>

Re: [Numpy-discussion] cannot import Numeric

2006-10-11 Thread Darren Dale
On Wednesday 11 October 2006 12:48, Carl Wenrich wrote: > The installation of Numpy went well, and numeric.py is in the python > site-packages/numpy/core directory. But when I run python, and enter import > Numeric, it says no module named Numeric. Please advise. import numpy

Re: [Numpy-discussion] Compile with atlas 3.7.17 fails

2006-10-11 Thread Travis Oliphant
Hanno Klemm wrote: >Hi, > >I don't know if this is a bug or just me doing something wrong (I >suspect the latter). I try to compile numpy-1.0rc1 with python2.5 and >atlas 3.7.17. > >I have build the atlas library myself, it doesn't give any errors >under make test or make pttest, so it seems to b

[Numpy-discussion] cannot import Numeric

2006-10-11 Thread Carl Wenrich
The installation of Numpy went well, and numeric.py is in the python site-packages/numpy/core directory. But when I run python, and enter import Numeric, it says no module named Numeric. Please advise. Carl - Using Tomcat but

Re: [Numpy-discussion] asmatrix and asarray exception

2006-10-11 Thread Travis Oliphant
Keith Goodman wrote: >On 10/11/06, Keith Goodman <[EMAIL PROTECTED]> wrote: > > >>This works: >> >> >> M.asmatrix(['a', 'b', None]) >>matrix([[a, b, None]], dtype=object) >> >>But this doesn't: >> >> >> M.asmatrix(['a', 'b', None, 'c']) >>TypeE

Re: [Numpy-discussion] naive RNG question

2006-10-11 Thread Charles R Harris
On 10/11/06, Alan G Isaac <[EMAIL PROTECTED]> wrote: Python's MT documentation exmphasize the period of theMT19937 algorithm but discusses not at all the seed size.The numpy documentation contains no commentary (I believe).Speaking from a position of utter RNG ignorance, seed size seems really impo

Re: [Numpy-discussion] asmatrix and asarray exception

2006-10-11 Thread Keith Goodman
On 10/11/06, Keith Goodman <[EMAIL PROTECTED]> wrote: > This works: > > >> M.asmatrix(['a', 'b', None]) > matrix([[a, b, None]], dtype=object) > > But this doesn't: > > >> M.asmatrix(['a', 'b', None, 'c']) > TypeError: expected a readable buffer object > > >> M.__version__ > '1.0rc1' > > It also do

[Numpy-discussion] asmatrix and asarray exception

2006-10-11 Thread Keith Goodman
This works: >> M.asmatrix(['a', 'b', None]) matrix([[a, b, None]], dtype=object) But this doesn't: >> M.asmatrix(['a', 'b', None, 'c']) TypeError: expected a readable buffer object >> M.__version__ '1.0rc1' It also doesn't work for asarray and for tuples. -

[Numpy-discussion] naive RNG question

2006-10-11 Thread Alan G Isaac
Python's MT documentation exmphasize the period of the MT19937 algorithm but discusses not at all the seed size. The numpy documentation contains no commentary (I believe). Speaking from a position of utter RNG ignorance, seed size seems really important too: why is it not discussed? I noticed thi

[Numpy-discussion] Compile with atlas 3.7.17 fails

2006-10-11 Thread Hanno Klemm
Hi, I don't know if this is a bug or just me doing something wrong (I suspect the latter). I try to compile numpy-1.0rc1 with python2.5 and atlas 3.7.17. I have build the atlas library myself, it doesn't give any errors under make test or make pttest, so it seems to be okay. if I try to build n

[Numpy-discussion] warning upon running numpy rc02 tests

2006-10-11 Thread O'Keefe, Michael
Just FYI, I got the following warning while running the unittests from RC02: Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information.

Re: [Numpy-discussion] ide for python/numpy/scipy/mpl, development ?

2006-10-11 Thread humufr
Le mardi 10 octobre 2006 16:30, Darren Dale a écrit : > On Tuesday 10 October 2006 15:41, [EMAIL PROTECTED] wrote: > > I asked if that will be possible to use ipython instead of the python > > console in eric4 (I know that it's not possible with eric3) but it's > > seems that eric4 does have it's o

Re: [Numpy-discussion] select part of array using two conditions

2006-10-11 Thread Nils Wagner
Mark Bakker wrote: > Hello - > > I want to select part of an array using two conditions. > I know how to do it with one condition (and it works great), but when > I use two conditions I get an error message? > This is probably easy, but I cannot figure it out. > Thanks for any help, Mark > > >>> a

Re: [Numpy-discussion] select part of array using two conditions

2006-10-11 Thread Francesc Altet
El dc 11 de 10 del 2006 a les 11:06 +0200, en/na Mark Bakker va escriure: > Hello - > > I want to select part of an array using two conditions. > I know how to do it with one condition (and it works great), but when > I use two conditions I get an error message? > This is probably easy, but I cann

[Numpy-discussion] select part of array using two conditions

2006-10-11 Thread Mark Bakker
Hello -I want to select part of an array using two conditions.I know how to do it with one condition (and it works great), but when I use two conditions I get an error message?This is probably easy, but I cannot figure it out. Thanks for any help, Mark>>> a = arange(10)>>> aarray([0, 1, 2, 3, 4, 5,

Re: [Numpy-discussion] incrementing along a diagonal

2006-10-11 Thread Johannes Loehnert
> I'm just wondering if there is a way that i can increment all the values > along a diagonal? Assume you want to change mat. # min() only necessary for non-square matrices index = arange(min(mat.shape[0], mat.shape[1])) # add 1 to each diagonal element matrix[index, index] += 1 # add some other

[Numpy-discussion] incrementing along a diagonal

2006-10-11 Thread David Novakovic
Hi, i'm moving some old perl PDL code to python. I've come across a line which changes values in a diagonal line accross a matrix. matrix.diagonal() returns a list of values, but making changes to these does not reflect in the original (naturally). I'm just wondering if there is a way that i can

Re: [Numpy-discussion] libblas error with NumPy 1.0rc2 on Python 2.5 and Red Hat 9

2006-10-11 Thread Karol Langner
On Wednesday 11 of October 2006 05:38, Steven H. Rogers wrote: > Is there a specific libblas required by NumPy? I just installed 1.0rc2 > and get this error. > > Python 2.5 (r25:51908, Sep 21 2006, 17:18:24) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "cred