Re: [Numpy-discussion] What is the logical value of nan?

2009-03-10 Thread Pearu Peterson
On Wed, March 11, 2009 7:50 am, Christopher Barker wrote: > > > Python does not distinguish between True and > > > False -- Python makes the distinction between something and nothing. > > In that context, NaN is nothing, thus False. Mathematically speaking, NaN is a quantity with undefined valu

Re: [Numpy-discussion] new numpy error in 1.3.0.dev6618

2009-03-10 Thread Charles R Harris
On Tue, Mar 10, 2009 at 11:45 PM, Charles R Harris < charlesr.har...@gmail.com> wrote: > > > On Tue, Mar 10, 2009 at 8:57 AM, Christopher Hanley wrote: > >> == >> ERROR: test_float_repr (test_scalarmath.TestRepr) >> --

Re: [Numpy-discussion] new numpy error in 1.3.0.dev6618

2009-03-10 Thread David Cournapeau
Charles R Harris wrote: > > > On Tue, Mar 10, 2009 at 8:57 AM, Christopher Hanley > wrote: > > == > ERROR: test_float_repr (test_scalarmath.TestRepr) >

Re: [Numpy-discussion] What is the logical value of nan?

2009-03-10 Thread Christopher Barker
Pauli Virtanen wrote: > Tue, 10 Mar 2009 13:08:17 -0600, Charles R Harris wrote: >> It isn't 0 so it should be True. Any disagreement? - 1 > Nonzero Python object, hence True. Empty sequences are False also. There was a lot of discussion about all this when Guido added Bool types to python. P

Re: [Numpy-discussion] new numpy error in 1.3.0.dev6618

2009-03-10 Thread Charles R Harris
On Tue, Mar 10, 2009 at 8:57 AM, Christopher Hanley wrote: > == > ERROR: test_float_repr (test_scalarmath.TestRepr) > -- > Traceback (most recent call last): >

Re: [Numpy-discussion] What is the logical value of nan?

2009-03-10 Thread David Cournapeau
Charles R Harris wrote: > > > On Tue, Mar 10, 2009 at 4:19 PM, Timothy Hochberg > mailto:tim.hochb...@ieee.org>> wrote: > > > > On Tue, Mar 10, 2009 at 2:49 PM, Charles R Harris > mailto:charlesr.har...@gmail.com>> wrote: > > > > On Tue, Mar 10, 2009 at 3:16 PM, Stéfan van der Walt

Re: [Numpy-discussion] Automatic differentiation (was Re : second-order gradient)

2009-03-10 Thread Osman
Hi, I just saw this python package : PyDX which may answer your needs. The original URL is not working, but the svn location exists. http://gr.anu.edu.au/svn/people/sdburton/pydx/doc/user-guide.html svn co http://gr.anu.edu.au/svn/people/sdburton/pydx br -osman __

Re: [Numpy-discussion] What is the logical value of nan?

2009-03-10 Thread Charles R Harris
On Tue, Mar 10, 2009 at 4:19 PM, Timothy Hochberg wrote: > > > On Tue, Mar 10, 2009 at 2:49 PM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> >> >> On Tue, Mar 10, 2009 at 3:16 PM, Stéfan van der Walt wrote: >> >>> 2009/3/10 Pauli Virtanen : >>> > Nonzero Python object, hence True. M

Re: [Numpy-discussion] What is the logical value of nan?

2009-03-10 Thread Timothy Hochberg
On Tue, Mar 10, 2009 at 2:49 PM, Charles R Harris wrote: > > > On Tue, Mar 10, 2009 at 3:16 PM, Stéfan van der Walt wrote: > >> 2009/3/10 Pauli Virtanen : >> > Nonzero Python object, hence True. Moreover, it's also True in Python: >> >> Also in C: >> >> #include >> #include >> >> int main() { >

Re: [Numpy-discussion] What is the logical value of nan?

2009-03-10 Thread Charles R Harris
On Tue, Mar 10, 2009 at 3:16 PM, Stéfan van der Walt wrote: > 2009/3/10 Pauli Virtanen : > > Nonzero Python object, hence True. Moreover, it's also True in Python: > > Also in C: > > #include > #include > > int main() { >double nan = sqrt(-1); >printf("%f\n", nan); >printf("%i\n", bo

Re: [Numpy-discussion] Buildbot issues

2009-03-10 Thread Stéfan van der Walt
Hi Pauli 2009/3/9 Pauli Virtanen : > There seem to be some problems with the buildbot: > > - It's not building on new commits automatically. > >  IIRC this could be fixed by removing some (all?) of buildmaster's cache >  files, and/or switching to PersistentSVNPoller. The firewall has still not b

Re: [Numpy-discussion] What is the logical value of nan?

2009-03-10 Thread Stéfan van der Walt
2009/3/10 Pauli Virtanen : > Nonzero Python object, hence True. Moreover, it's also True in Python: Also in C: #include #include int main() { double nan = sqrt(-1); printf("%f\n", nan); printf("%i\n", bool(nan)); return 0; } $ ./nan nan 1 Cheers Stéfan ___

Re: [Numpy-discussion] What is the logical value of nan?

2009-03-10 Thread Pauli Virtanen
Tue, 10 Mar 2009 13:08:17 -0600, Charles R Harris wrote: > It isn't 0 so it should be True. Any disagreement? +1 Nonzero Python object, hence True. Moreover, it's also True in Python: >>> import numpy as np >>> type(np.nan) >>> bool(np.nan) True IMHO, we should follow Python here, otherwise un

Re: [Numpy-discussion] Changes and new workflow on Trac

2009-03-10 Thread David Huard
Plain old firefox 3.0.6 on fedora 9. On Tue, Mar 10, 2009 at 4:11 PM, Charles R Harris wrote: > > > On Tue, Mar 10, 2009 at 2:07 PM, Stéfan van der Walt wrote: > >> 2009/3/10 David Huard : >> > but, if I try to login, I get the same error again. I tried to reset the >> > password, register under

Re: [Numpy-discussion] Changes and new workflow on Trac

2009-03-10 Thread Charles R Harris
On Tue, Mar 10, 2009 at 2:07 PM, Stéfan van der Walt wrote: > 2009/3/10 David Huard : > > but, if I try to login, I get the same error again. I tried to reset the > > password, register under a new name, but I always get the following > message: > > > > The browser has stopped trying to retrieve t

Re: [Numpy-discussion] Changes and new workflow on Trac

2009-03-10 Thread Stéfan van der Walt
2009/3/10 David Huard : > but, if I try to login, I get the same error again. I tried to reset the > password, register under a new name, but I always get the following message: > > The browser has stopped trying to retrieve the requested item. The site is > redirecting the request in a way that wi

Re: [Numpy-discussion] What is the logical value of nan?

2009-03-10 Thread Nadav Horesh
I think it should be considered as roughly (the numerical) equivalent to None, therefore False Nadav. -הודעה מקורית- מאת: numpy-discussion-boun...@scipy.org בשם Charles R Harris נשלח: ג 10-מרץ-09 21:08 אל: numpy-discussion נושא: [Numpy-discussion] What is the logical value of nan? I

[Numpy-discussion] What is the logical value of nan?

2009-03-10 Thread Charles R Harris
It isn't 0 so it should be True. Any disagreement?... Chuck ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] [Matplotlib-users] Google summer of Code 2009

2009-03-10 Thread Michael Droettboom
Christopher Barker wrote: > Michael Droettboom wrote: > >> The PSF will do the work of applying to Google -- we can encourage >> prospective students and mentors to apply through the PSF. >> > > hmmm -- I wonder if that is best -- it would put MPL projects in > competition with all other

Re: [Numpy-discussion] [SciPy-user] Google summer of Code 2009

2009-03-10 Thread Jarrod Millman
On Tue, Mar 10, 2009 at 11:32 AM, Christopher Barker wrote: > hmmm -- I wonder if that is best -- it would put MPL projects in > competition with all other python projects. > > My first thought is that a SciPy application would be best -- with > SciPy, numpy, MPL, Sage, Cython, etc, it's plenty bi

[Numpy-discussion] [JOB] Short-term python programming consultant - funds expire soon!

2009-03-10 Thread Rob Clewley
Dear Pythonistas, Our open-source software project (PyDSTool) has money to hire an experienced Python programmer on a short-term, per-task basis as a technical consultant (i.e., no fringe benefits offered). The work can be done remotely and will be paid after the satisfactory completion of the obj

Re: [Numpy-discussion] Google summer of Code 2009

2009-03-10 Thread Christopher Barker
Michael Droettboom wrote: > The PSF will do the work of applying to Google -- we can encourage > prospective students and mentors to apply through the PSF. hmmm -- I wonder if that is best -- it would put MPL projects in competition with all other python projects. My first thought is that a Sci

Re: [Numpy-discussion] Numpy documentation: status and distribution for 1.3.0

2009-03-10 Thread Pauli Virtanen
Tue, 10 Mar 2009 18:22:12 +, Pauli Virtanen wrote: > Tue, 10 Mar 2009 15:27:32 +0900, David Cournapeau wrote: >> For the upcoming 1.3.0 release, I would like to distribute the (built) >> documentation in some way. But first, I need to be able to build it :) > > Yep, buildability would be a ni

Re: [Numpy-discussion] Numpy documentation: status and distribution for 1.3.0

2009-03-10 Thread Pauli Virtanen
Tue, 10 Mar 2009 15:27:32 +0900, David Cournapeau wrote: > For the upcoming 1.3.0 release, I would like to distribute the (built) > documentation in some way. But first, I need to be able to build it :) Yep, buildability would be a nice feature :) > What are the exact requirements to build the do

Re: [Numpy-discussion] Changes and new workflow on Trac

2009-03-10 Thread David Huard
On Tue, Mar 10, 2009 at 1:28 PM, David Huard wrote: > > > On Tue, Mar 10, 2009 at 9:44 AM, Stéfan van der Walt wrote: > >> Hi David >> >> 2009/3/10 David Huard : >> > Stefan, >> > >> > The SciPy site is really nice, but the NumPy site returns a Page Load >> Error. >> >> Which page are you referri

Re: [Numpy-discussion] Changes and new workflow on Trac

2009-03-10 Thread David Huard
On Tue, Mar 10, 2009 at 9:44 AM, Stéfan van der Walt wrote: > Hi David > > 2009/3/10 David Huard : > > Stefan, > > > > The SciPy site is really nice, but the NumPy site returns a Page Load > Error. > > Which page are you referring to? > > http://projects.scipy.org/numpy > > seems to work fine. >

Re: [Numpy-discussion] array 2 string

2009-03-10 Thread josef . pktd
On Tue, Mar 10, 2009 at 11:37 AM, Pierre GM wrote: > Simplifying the loops from a previous poster: >  >>>  "\n".join((" ".join((str(_) for _ in x)) for x in a)) > - Show quoted text - > or if you want to control the formatting, e.g. print "\n".join(("%-10.6f "*a.shape[1] % tuple(x) for x in a))

Re: [Numpy-discussion] Can we assume both FPU and ALU to have same endianness for numpy ?

2009-03-10 Thread Francesc Alted
A Tuesday 10 March 2009, David Cournapeau escrigué: > Francesc Alted wrote: > > A Tuesday 10 March 2009, David Cournapeau escrigué: > >> Hi, > >> > >> While working on portable macros for NAN, INF and co, I was > >> wondering why the current version of my code was working > >> (http://projects.

Re: [Numpy-discussion] array 2 string

2009-03-10 Thread Pierre GM
Simplifying the loops from a previous poster: >>> "\n".join((" ".join((str(_) for _ in x)) for x in a)) ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] array 2 string

2009-03-10 Thread Chris Colbert
a = array() b = str(a).replace('[','').replace(']','') there's probably a better way, but it works. On Tue, Mar 10, 2009 at 12:21 PM, Mark Bakker wrote: > Hello, > > I want to convert an array to a string. > > I like array2string, but it puts these annoying square brackets around > the arr

Re: [Numpy-discussion] array 2 string

2009-03-10 Thread Michael S. Gilbert
On Tue, 10 Mar 2009 17:21:23 +0100, Mark Bakker wrote: > Hello, > > I want to convert an array to a string. > > I like array2string, but it puts these annoying square brackets around > the array, like > > [[1 2 3], > [3 4 5]] > > Anyway we can suppress the square brackets and get (this is what

Re: [Numpy-discussion] Can we assume both FPU and ALU to have same endianness for numpy ?

2009-03-10 Thread David Cournapeau
Francesc Alted wrote: > A Tuesday 10 March 2009, David Cournapeau escrigué: > >> Hi, >> >> While working on portable macros for NAN, INF and co, I was >> wondering why the current version of my code was working >> (http://projects.scipy.org/numpy/browser/trunk/numpy/core/include/num >> py/np

[Numpy-discussion] array 2 string

2009-03-10 Thread Mark Bakker
Hello, I want to convert an array to a string. I like array2string, but it puts these annoying square brackets around the array, like [[1 2 3], [3 4 5]] Anyway we can suppress the square brackets and get (this is what is written with savetxt, but I cannot get it to store in a variable) 1 2 3 4

Re: [Numpy-discussion] Can we assume both FPU and ALU to have same endianness for numpy ?

2009-03-10 Thread Francesc Alted
A Tuesday 10 March 2009, David Cournapeau escrigué: > Hi, > > While working on portable macros for NAN, INF and co, I was > wondering why the current version of my code was working > (http://projects.scipy.org/numpy/browser/trunk/numpy/core/include/num >py/npy_math.h, first lines). I then reali

[Numpy-discussion] Can we assume both FPU and ALU to have same endianness for numpy ?

2009-03-10 Thread David Cournapeau
Hi, While working on portable macros for NAN, INF and co, I was wondering why the current version of my code was working (http://projects.scipy.org/numpy/browser/trunk/numpy/core/include/numpy/npy_math.h, first lines). I then realized that IEEE 754 did not impose an endianness, contrary to my

Re: [Numpy-discussion] Another question on reading from binary FORTRAN file

2009-03-10 Thread Sturla Molden
Mark Bakker wrote: > Thanks, Mike. > This seems to be a really easy way. > One more question. > It turns out my file also contains a character string of 16 characters. > I tried > np.fromfile(fd,np.str,16) > np.fromfile(fd,np.uint8,16).tostring() __

Re: [Numpy-discussion] Another question on reading from binary FORTRAN file

2009-03-10 Thread Michael S. Gilbert
On Tue, 10 Mar 2009 16:05:06 +0100, Mark Bakker wrote: > Thanks, Mike. > This seems to be a really easy way. > One more question. > It turns out my file also contains a character string of 16 characters. > I tried > np.fromfile(fd,np.str,16) > But that gives an error. > Can I read a characterstrin

Re: [Numpy-discussion] Another question on reading from binary FORTRAN file

2009-03-10 Thread Mark Bakker
Thanks, Mike. This seems to be a really easy way. One more question. It turns out my file also contains a character string of 16 characters. I tried np.fromfile(fd,np.str,16) But that gives an error. Can I read a characterstring with fromfile? I know, I can read with fd.read, but I am wondering if

[Numpy-discussion] new numpy error in 1.3.0.dev6618

2009-03-10 Thread Christopher Hanley
== ERROR: test_float_repr (test_scalarmath.TestRepr) -- Traceback (most recent call last): File "/Users/chanley/dev/site-packages/lib/python/numpy/core/tests/t

Re: [Numpy-discussion] why numpy.round get a different result from python round function?

2009-03-10 Thread Stéfan van der Walt
Hi David 2009/3/10 shuwj5...@163.com : > I read the doc for numpy about round function: > > - > For values exactly halfway between rounded decimal values, Numpy rounds > to the nearest even value. Thus 1.5 and 2.5 round to 2.0, -0.5 and 0.5 > round to 0.0, etc. Results may also be surprising d

Re: [Numpy-discussion] syntax error in scalartypes.inc.src

2009-03-10 Thread David Cournapeau
James Watson wrote: > In revision 6609, numpy fails to build on linux x86_64 due to an extra > comma on line 779 of numpy/core/src/scalartypes.inc.src. > Fixed in r6615, cheers, David ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http

Re: [Numpy-discussion] Changes and new workflow on Trac

2009-03-10 Thread Stéfan van der Walt
Hi David 2009/3/10 David Huard : > Stefan, > > The SciPy site is really nice, but the NumPy site returns a Page Load Error. Which page are you referring to? http://projects.scipy.org/numpy seems to work fine. Cheers Stéfan ___ Numpy-discussion mailin

Re: [Numpy-discussion] Changes and new workflow on Trac

2009-03-10 Thread David Huard
Stefan, The SciPy site is really nice, but the NumPy site returns a Page Load Error. David On Mon, Mar 9, 2009 at 3:35 AM, Stéfan van der Walt wrote: > Hi all, > > Here is an outline of recent changes made to the Trac system. > > I have modified the ticket workflow on > projects.scipy.org/{

[Numpy-discussion] syntax error in scalartypes.inc.src

2009-03-10 Thread James Watson
In revision 6609, numpy fails to build on linux x86_64 due to an extra comma on line 779 of numpy/core/src/scalartypes.inc.src. ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Another question on reading from binary FORTRAN file

2009-03-10 Thread Sturla Molden
On 3/9/2009 9:45 PM, Mark Bakker wrote: > How do I read these into Python? One option is to read the file in Fortran (using the same compiler), and call Fortran from python using f2py. If you can write the file in Fortran, you can read the file in Fortran. Another option to find out how the bi

Re: [Numpy-discussion] dot product

2009-03-10 Thread Nadav Horesh
dot(X.transpose(), Y)**2 / ( (X*X).sum(0)[:,None] * (Y*Y).sum(0) ) Nadav -הודעה מקורית- מאת: numpy-discussion-boun...@scipy.org בשם Nils Wagner נשלח: ג 10-מרץ-09 11:37 אל: numpy-discussion@scipy.org נושא: [Numpy-discussion] dot product Hi all, The dot product can be defined for tw

[Numpy-discussion] dot product

2009-03-10 Thread Nils Wagner
Hi all, The dot product can be defined for two vectors x and y by x·y=|x||y| \cos(\theta), where theta is the angle between the vectors and |x| is the norm. Now assume that we have arrays(matrices) X = [x_1, ..., x_m] Y = [y_1, ..., y_s] m <> s Is there a built-in function to comp

Re: [Numpy-discussion] Numpy documentation: status and distribution for 1.3.0

2009-03-10 Thread Eric Firing
David Cournapeau wrote: > Hi, > > For the upcoming 1.3.0 release, I would like to distribute the (built) > documentation in some way. But first, I need to be able to build it :) > What are the exact requirements to build the documentation ? Is sphinx > 0.5 enough ? I can't manage to build it on ei