Re: [Numpy-discussion] Importance of order when summing values inanarray

2008-12-09 Thread Nadav Horesh
float128 are 16 bytes wide but have the structure of x87 80-bits + extra 6 bytes for alignment: >From "http://lwn.net/2001/features/OLS/pdf/pdf/x86-64.pdf": "... The x87 stack with 80-bit precision is only used for long double." And: >>> e47 = float128(1e-47) >>> e30 = float128(1e-30) >>> e50 =

Re: [Numpy-discussion] Some numpy statistics

2008-12-09 Thread robert . kern
On Wed, Dec 10, 2008 at 01:49, Charles R Harris <[EMAIL PROTECTED]> wrote: > Hi All, > > I bumped into this while searching for something else: > http://www.ohloh.net/p/numpy/analyses/latest -14 lines of Javascript? -- Robert Kern "I have come to believe that the whole world is an enigma, a har

[Numpy-discussion] Some numpy statistics

2008-12-09 Thread Charles R Harris
Hi All, I bumped into this while searching for something else: http://www.ohloh.net/p/numpy/analyses/latest Chuck ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] genloadtxt : last call

2008-12-09 Thread Gael Varoquaux
On Tue, Dec 09, 2008 at 01:34:29AM -0800, Jarrod Millman wrote: > It was decided last year that numpy io should provide simple, generic, > core io functionality. While scipy io would provide more domain- or > application-specific io code (e.g., Matlab IO, WAV IO, etc.) My > vision for scipy io, w

Re: [Numpy-discussion] Numscons issues: numpy.core.umath_tests not built, built-in ld detection, MAIN__ not being set-up

2008-12-09 Thread David Cournapeau
Peter Norton wrote: > I've got a few issues that I hope won't be overwhelming on one message: > > (1) Because of some issues in the past in building numpy with > numscons, the numpy.core.umath_tests don't get built with > numpy+numscons (at least not as of svn version 6128). > > $ python -c 'import

Re: [Numpy-discussion] how do I delete unused matrix to save the memory?

2008-12-09 Thread Scott Sinclair
> 2008/12/10 Robert Kern <[EMAIL PROTECTED]>: > On Mon, Dec 8, 2008 at 19:15, frank wang <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I have a program with some variables consume a lot of memory. The first time >> I run it, it is fine. The second time I run it, I will get MemoryError. If I >> close the

Re: [Numpy-discussion] Importance of order when summing values in anarray

2008-12-09 Thread Charles R Harris
On Tue, Dec 9, 2008 at 8:10 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Tue, Dec 9, 2008 at 21:01, Charles R Harris > <[EMAIL PROTECTED]> wrote: > > > > > > On Tue, Dec 9, 2008 at 1:40 PM, Robert Kern <[EMAIL PROTECTED]> > wrote: > >> > >> On Tue, Dec 9, 2008 at 09:51, Nadav Horesh <[EMAIL PRO

Re: [Numpy-discussion] Importance of order when summing values in anarray

2008-12-09 Thread Robert Kern
On Tue, Dec 9, 2008 at 21:01, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > On Tue, Dec 9, 2008 at 1:40 PM, Robert Kern <[EMAIL PROTECTED]> wrote: >> >> On Tue, Dec 9, 2008 at 09:51, Nadav Horesh <[EMAIL PROTECTED]> wrote: >> > As much as I know float128 are in fact 80 bits (64 mantissa + 16 >>

Re: [Numpy-discussion] How to unitize a array in numpy?

2008-12-09 Thread Grissiom
On Wed, Dec 10, 2008 at 11:04, Robert Kern <[EMAIL PROTECTED]> wrote: > v / numpy.linalg.norm(v) > Thanks a lot ~;) -- Cheers, Grissiom ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discu

Re: [Numpy-discussion] How to unitize a array in numpy?

2008-12-09 Thread Robert Kern
On Tue, Dec 9, 2008 at 20:56, Grissiom <[EMAIL PROTECTED]> wrote: > On Wed, Dec 10, 2008 at 10:36, Robert Kern <[EMAIL PROTECTED]> wrote: >> >> On Tue, Dec 9, 2008 at 20:24, Grissiom <[EMAIL PROTECTED]> wrote: >> > Hi all, >> > >> > Nice to neet you all. I am a newbie in numpy. Is there any functio

Re: [Numpy-discussion] how do I delete unused matrix to save the memory?

2008-12-09 Thread Robert Kern
On Mon, Dec 8, 2008 at 19:15, frank wang <[EMAIL PROTECTED]> wrote: > Hi, > > I have a program with some variables consume a lot of memory. The first time > I run it, it is fine. The second time I run it, I will get MemoryError. If I > close the ipython and reopen it again, then I can run the progr

Re: [Numpy-discussion] Importance of order when summing values in anarray

2008-12-09 Thread Charles R Harris
On Tue, Dec 9, 2008 at 1:40 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Tue, Dec 9, 2008 at 09:51, Nadav Horesh <[EMAIL PROTECTED]> wrote: > > As much as I know float128 are in fact 80 bits (64 mantissa + 16 > exponent) so the precision is 18-19 digits (not 34) > > float128 should be 128 bits

Re: [Numpy-discussion] How to unitize a array in numpy?

2008-12-09 Thread Grissiom
On Wed, Dec 10, 2008 at 10:36, Robert Kern <[EMAIL PROTECTED]> wrote: > On Tue, Dec 9, 2008 at 20:24, Grissiom <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > Nice to neet you all. I am a newbie in numpy. Is there any function that > > could unitize a array? > > If you mean like the Mathematica fun

Re: [Numpy-discussion] Numscons issues: numpy.core.umath_tests not built, built-in ld detection, MAIN__ not being set-up

2008-12-09 Thread Charles R Harris
On Tue, Dec 9, 2008 at 4:50 PM, Peter Norton < [EMAIL PROTECTED]> wrote: > I've got a few issues that I hope won't be overwhelming on one message: > > (1) Because of some issues in the past in building numpy with > numscons, the numpy.core.umath_tests don't get built with > numpy+numscons (at leas

Re: [Numpy-discussion] how do I delete unused matrix to save the memory?

2008-12-09 Thread Robert Kern
On Tue, Dec 9, 2008 at 20:40, Vagabond_Aero <[EMAIL PROTECTED]> wrote: > I have the same problem. I tried the del command below, but foundon that it > removes the names of the ndarrays from memory, but does not free up the > memory on my XP system (python 2.5.2, numpy 1.2.1). Regular python objec

Re: [Numpy-discussion] how do I delete unused matrix to save the memory?

2008-12-09 Thread Vagabond_Aero
I have the same problem. I tried the del command below, but foundon that it removes the names of the ndarrays from memory, but does not free up the memory on my XP system (python 2.5.2, numpy 1.2.1). Regular python objects release their memory when I use the del command, but it looks like the nda

Re: [Numpy-discussion] How to unitize a array in numpy?

2008-12-09 Thread Robert Kern
On Tue, Dec 9, 2008 at 20:24, Grissiom <[EMAIL PROTECTED]> wrote: > Hi all, > > Nice to neet you all. I am a newbie in numpy. Is there any function that > could unitize a array? If you mean like the Mathematica function Unitize[] defined here: http://reference.wolfram.com/mathematica/ref/Unitiz

Re: [Numpy-discussion] How to unitize a array in numpy?

2008-12-09 Thread Robert Kern
On Tue, Dec 9, 2008 at 20:24, Grissiom <[EMAIL PROTECTED]> wrote: > Hi all, > > Nice to neet you all. I am a newbie in numpy. Is there any function that > could unitize a array? What do you mean by "unitize"? -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless e

[Numpy-discussion] How to unitize a array in numpy?

2008-12-09 Thread Grissiom
Hi all, Nice to neet you all. I am a newbie in numpy. Is there any function that could unitize a array? Thanks in advance. -- Cheers, Grissiom ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy

[Numpy-discussion] Numscons issues: numpy.core.umath_tests not built, built-in ld detection, MAIN__ not being set-up

2008-12-09 Thread Peter Norton
I've got a few issues that I hope won't be overwhelming on one message: (1) Because of some issues in the past in building numpy with numscons, the numpy.core.umath_tests don't get built with numpy+numscons (at least not as of svn version 6128). $ python -c 'import numpy; print numpy.__version__;

Re: [Numpy-discussion] Support for sparse matrix in Distance function (and clustering)?

2008-12-09 Thread Damian Eads
Hi, Can you be more specific? Do you need sparse matrices to represent observation vectors because they are sparse? Or do you need sparse matrices to represent distance matrices because most vectors you are clustering are similar while a few are dissimilar? The clustering code is written mostly i

Re: [Numpy-discussion] Excluding index in numpy like negative index in R?

2008-12-09 Thread Keith Goodman
On Tue, Dec 9, 2008 at 12:25 PM, Bab Tei <[EMAIL PROTECTED]> wrote: > I can exclude a list of items by using negative index in R (R-project) ie > myarray[-excludeindex]. As negative indexing in numpy (And python) behave > differently ,how can I exclude a list of item in numpy? Here's a painful

Re: [Numpy-discussion] Excluding index in numpy like negative index in R?

2008-12-09 Thread Joshua Lippai
You can make a mask array in numpy to prune out items from an array that you don't want, denoting indices you want to keep with 1's and those you don't want to keep with 0's. For instance, a = np.array([1,3,45,67,123]) mask = np.array([0,1,1,0,1],dtype=np.bool) anew = a[mask] will set anew equal

Re: [Numpy-discussion] Importance of order when summing values in anarray

2008-12-09 Thread Robert Kern
On Tue, Dec 9, 2008 at 09:51, Nadav Horesh <[EMAIL PROTECTED]> wrote: > As much as I know float128 are in fact 80 bits (64 mantissa + 16 exponent) so > the precision is 18-19 digits (not 34) float128 should be 128 bits wide. If it's not on your platform, please let us know as that is a bug in you

[Numpy-discussion] Support for sparse matrix in Distance function (and clustering)?

2008-12-09 Thread Bab Tei
Hi Does the distance function in spatial package support sparse matrix? regards ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] Excluding index in numpy like negative index in R?

2008-12-09 Thread Bab Tei
Hi I can exclude a list of items by using negative index in R (R-project) ie myarray[-excludeindex]. As negative indexing in numpy (And python) behave differently ,how can I exclude a list of item in numpy? Regards, Teimourpour ___ Numpy-discus

Re: [Numpy-discussion] genloadtxt : last call

2008-12-09 Thread Pierre GM
On Dec 9, 2008, at 12:59 PM, Christopher Barker wrote: > Jarrod Millman wrote: > >>> From the user's perspective, I would like all the NumPy IO code to >>> be >> in the same place in NumPy; and all the SciPy IO code to be in the >> same place in SciPy. > > +1 So, no problem w/ importing numpy.

Re: [Numpy-discussion] genloadtxt : last call

2008-12-09 Thread Christopher Barker
Jarrod Millman wrote: >>From the user's perspective, I would like all the NumPy IO code to be > in the same place in NumPy; and all the SciPy IO code to be in the > same place in SciPy. +1 > So I > wonder if it would make sense to incorporate AstroAsciiData? Doesn't it overlap a lot with genlo

Re: [Numpy-discussion] numpy build error on Solaris, No module named _md5

2008-12-09 Thread Michael Abshoff
Gong, Shawn (Contractor) wrote: > hi list, Hi Shawn, > I tried to build numpy 1.2.1 on Solaris 9 with gcc 3.4.6 > > when I typed “python setup.py build”, I got error from hashlib.py > > File "/home/sgong/dev181/dist/lib/python2.5/hashlib.py", line 133, in > > > md5 = __get_builtin_cons

Re: [Numpy-discussion] numpy build error on Solaris, No module named _md5

2008-12-09 Thread Matthieu Brucher
You should ask on a general Python list, as it's a Python problem, not a numpy one ;) Matthieu PS: look at the log when you built Python, there must be a mention of the not building of the md5 module. 2008/12/9 Gong, Shawn (Contractor) <[EMAIL PROTECTED]>: > hi Matthieu, > > import md5 doesn't w

Re: [Numpy-discussion] numpy build error on Solaris, No module named _md5

2008-12-09 Thread Gong, Shawn (Contractor)
hi Matthieu, import md5 doesn't work. I got: >>> import md5 Traceback (most recent call last): File "", line 1, in File "/home/sgong/dev181/dist.org/lib/python2.5/md5.py", line 6, in from hashlib import md5 File "/home/sgong/dev181/dist.org/lib/python2.5/hashlib.py", line 133, in

[Numpy-discussion] One Solution to: What to use to read and write numpy arrays to a file?

2008-12-09 Thread Lou Pecora
I found one solution that's pretty simple for easy read and write to/from a file of a numpy array (see my original message below). Just use the method tolist(). e.g. a complex 2 x 2 array arr=array([[1.0,3.0-7j],[55.2+4.0j,-95.34]]) ls=arr.tolist() Then use the repr - eval pairings to write a

Re: [Numpy-discussion] numpy build error on Solaris, No module named _md5

2008-12-09 Thread David Cournapeau
On Wed, Dec 10, 2008 at 1:00 AM, Gong, Shawn (Contractor) <[EMAIL PROTECTED]> wrote: > hi list, > > Do I need to do the same on Solaris? This has nothing to do with ATLAS. You did not build correctly python, or the python you are using is not built correctly. _md5 is a module from python, not from

Re: [Numpy-discussion] numpy build error on Solaris, No module named _md5

2008-12-09 Thread Matthieu Brucher
Hi, Does: >>> import md5 work? If it doesn't, it's a packaging problem. md5 must be available. Matthieu 2008/12/9 Gong, Shawn (Contractor) <[EMAIL PROTECTED]>: > hi list, > > I tried to build numpy 1.2.1 on Solaris 9 with gcc 3.4.6 > > when I typed "python setup.py build", I got error from has

[Numpy-discussion] numpy build error on Solaris, No module named _md5

2008-12-09 Thread Gong, Shawn (Contractor)
hi list, I tried to build numpy 1.2.1 on Solaris 9 with gcc 3.4.6 when I typed "python setup.py build", I got error from hashlib.py File "/home/sgong/dev181/dist/lib/python2.5/hashlib.py", line 133, in md5 = __get_builtin_constructor('md5') File "/home/sgong/dev181/dist/lib/python2.5/has

Re: [Numpy-discussion] Importance of order when summing values in anarray

2008-12-09 Thread Nadav Horesh
As much as I know float128 are in fact 80 bits (64 mantissa + 16 exponent) so the precision is 18-19 digits (not 34) Nadav. -הודעה מקורית- מאת: [EMAIL PROTECTED] בשם Bruce Southey נשלח: ג 09-דצמבר-08 17:46 אל: Discussion of Numerical Python נושא: Re: [Numpy-discussion] Importance of o

Re: [Numpy-discussion] Importance of order when summing values in anarray

2008-12-09 Thread Bruce Southey
Hanni Ali wrote: > Hi Bruce, > > Ahh, but I would have thought the precision for the array operation > would be the same no matter which values I wish to sum? The array is > in float64 in all cases. > > I would not have thought altering the type of the integer values would > make any difference

Re: [Numpy-discussion] Importance of order when summing values in anarray

2008-12-09 Thread Hanni Ali
Hi Bruce, Ahh, but I would have thought the precision for the array operation would be the same no matter which values I wish to sum? The array is in float64 in all cases. I would not have thought altering the type of the integer values would make any difference as these indices are all below 5 m

Re: [Numpy-discussion] Importance of order when summing values in anarray

2008-12-09 Thread Bruce Southey
Nadav Horesh wrote: > The highest accuracy is obtained when you sum an acceding ordered series, and > the lowest accuracy with descending ordered. In between you might get a > variety of rounding errors. > > Nadav. > > -הודעה מקורית- > מאת: [EMAIL PROTECTED] בשם Hanni Ali > נשלח: ג 09-

Re: [Numpy-discussion] Importance of order when summing values in anarray

2008-12-09 Thread Hanni Ali
Thank you Nadav. 2008/12/9 Nadav Horesh <[EMAIL PROTECTED]> > The highest accuracy is obtained when you sum an acceding ordered series, > and the lowest accuracy with descending ordered. In between you might get a > variety of rounding errors. > > Nadav. > > -הודעה מקורית- > מאת: [EMAIL

Re: [Numpy-discussion] Line of best fit!

2008-12-09 Thread Alan G Isaac
On 12/8/2008 3:32 PM James apparently wrote: > I have a very simple plot, and the lines join point to point, however i > would like to add a line of best fit now onto the chart, i am really new > to python etc, and didnt really understand those links! See the `slope_intercept` method of the OLS

Re: [Numpy-discussion] Importance of order when summing values in anarray

2008-12-09 Thread Nadav Horesh
The highest accuracy is obtained when you sum an acceding ordered series, and the lowest accuracy with descending ordered. In between you might get a variety of rounding errors. Nadav. -הודעה מקורית- מאת: [EMAIL PROTECTED] בשם Hanni Ali נשלח: ג 09-דצמבר-08 16:07 אל: Discussion of Num

[Numpy-discussion] Importance of order when summing values in an array

2008-12-09 Thread Hanni Ali
Hi All, I have encountered a puzzling issue and I am not certain if this is a mistake of my own doing or not. Would someone kindly just look over this issue to make sure I'm not doing something very silly. So, why would the sum of an array have a different value depending on the order I select th

Re: [Numpy-discussion] Line of best fit!

2008-12-09 Thread Lane Brooks
James wrote: > Hi, > > Thanks for all your help so far! > > Right i think it would be easier to just show you the chart i have so far; > > -- > import numpy as np > import matplotlib.pyplot as plt > > plt.plot([4,8,12,16,20,24], [0.008,0.016,0.021,0.038,0.062,0.116], 'bo') >

Re: [Numpy-discussion] Line of best fit!

2008-12-09 Thread James
Hi, Thanks for all your help so far! Right i think it would be easier to just show you the chart i have so far; -- import numpy as np import matplotlib.pyplot as plt plt.plot([4,8,12,16,20,24], [0.008,0.016,0.021,0.038,0.062,0.116], 'bo') plt.xlabel("F (Number of washer

[Numpy-discussion] Please help prepare the SciPy 0.7 release notes

2008-12-09 Thread Jarrod Millman
We are almost ready for SciPy 0.7.0rc1 (we just need to sort out the Numerical Recipes issues and I haven't had time to look though them yet). So I wanted to ask once more for help with preparing the release notes: http://projects.scipy.org/scipy/scipy/browser/trunk/doc/release/0.7.0-notes.rst Th

Re: [Numpy-discussion] genloadtxt : last call

2008-12-09 Thread Jarrod Millman
On Fri, Dec 5, 2008 at 3:59 PM, Pierre GM <[EMAIL PROTECTED]> wrote: > All, > Here's the latest version of genloadtxt, with some recent corrections. With > just a couple of tweaking, we end up with some decent speed: it's still > slower than np.loadtxt, but only 15% so according to the test at the