Re: [Numpy-discussion] Some numpy statistics

2008-12-10 Thread Charles R Harris
On Wed, Dec 10, 2008 at 12:55 AM, <[EMAIL PROTECTED]> wrote: > 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? > We

Re: [Numpy-discussion] Some numpy statistics

2008-12-10 Thread Robert Kern
On Wed, Dec 10, 2008 at 02:22, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > On Wed, Dec 10, 2008 at 12:55 AM, <[EMAIL PROTECTED]> wrote: >> >> On Wed, Dec 10, 2008 at 01:49, Charles R Harris >> <[EMAIL PROTECTED]> wrote: >> > Hi All, >> > >> > I bumped into this while searching for something e

Re: [Numpy-discussion] Some numpy statistics

2008-12-10 Thread David Cournapeau
Charles R Harris wrote: > > > On Wed, Dec 10, 2008 at 12:55 AM, <[EMAIL PROTECTED] > > wrote: > > On Wed, Dec 10, 2008 at 01:49, Charles R Harris > <[EMAIL PROTECTED] > wrote: > > Hi All, > > > > I bumped into this while search

[Numpy-discussion] Little vectorization help...

2008-12-10 Thread Andrea Gavana
Hi All, I am tryin to "vectorize" 3 nested for loops but I am not having much success. Here is the code I use: import numpy import numpy.ma as masked grid = numpy.zeros((nx, ny), dtype=numpy.float32) xOut = numpy.zeros((nx, ny), dtype=numpy.float32) yOut = numpy.zeros((nx, ny), dtype=numpy.f

[Numpy-discussion] Little vectorization help...

2008-12-10 Thread Andrea Gavana
Hi All, I am tryin to "vectorize" 3 nested for loops but I am not having much success. Here is the code I use: import numpy import numpy.ma as masked grid = numpy.zeros((nx, ny), dtype=numpy.float32) xOut = numpy.zeros((nx, ny), dtype=numpy.float32) yOut = numpy.zeros((nx, ny), dtype=numpy.f

[Numpy-discussion] Superclassing numpy.matrix: got an unexpected keyword argument 'dtype'

2008-12-10 Thread Robert.Conde
Hello, I'm using numpy-1.1.1 for Python 2.3. I'm trying to create a class that acts just like the numpy.matrix class with my own added methods and attributes. I want to pass my class a list of custom "instrument" objects and do some math based on these objects to set the matrix. To this end

Re: [Numpy-discussion] access ndarray in C++

2008-12-10 Thread Ravi
On Wednesday 23 April 2008 15:48:23 Christopher Barker wrote: > > - Boost Python [1]. Especially if you want usable C++ integration. (ie. > > more than basic templates, etc.) > > What's the status of the Boost array object? maintained? updated for > recent numpy? The boost.python array object is s

Re: [Numpy-discussion] Superclassing numpy.matrix: got an unexpected keyword argument 'dtype'

2008-12-10 Thread Pierre GM
Robert, Transforming your matrix to a list before computation isn't very efficient. If you do need some extra parameters in your __init__ to be compatible with other functions such as asmatrix, well, just add them, or use a coverall **kwargs def __init__(self, instruments, **kwargs) No guaran

Re: [Numpy-discussion] access ndarray in C++

2008-12-10 Thread Ravi
Oops, please ignore my previous message. I just started using a new mail client which marked some of my old messages (which I had tagged interesting) the same as new messages and I just blindly replied to them without checking the date. Sorry about the spam. Ravi _

[Numpy-discussion] Find index of repeated numbers in array

2008-12-10 Thread Ross Williamson
Hi Everyone I think I'm missing something really obvious but what I would like to do is extract the indexes from an array where a number matches - For example data = [0,1,2,960,5,6,960,7] I would like to know, for example the indices which match 960 - i.e. it would return 3 and 6 I could

Re: [Numpy-discussion] Find index of repeated numbers in array

2008-12-10 Thread Robert Cimrman
Ross Williamson wrote: > Hi Everyone > > I think I'm missing something really obvious but what I would like to > do is extract the indexes from an array where a number matches - For > example > > data = [0,1,2,960,5,6,960,7] > > I would like to know, for example the indices which match 960 -

Re: [Numpy-discussion] Find index of repeated numbers in array

2008-12-10 Thread Nils Wagner
On Wed, 10 Dec 2008 11:38:11 -0500 Ross Williamson <[EMAIL PROTECTED]> wrote: > Hi Everyone > > I think I'm missing something really obvious but what I >would like to > do is extract the indexes from an array where a number >matches - For > example > > data = [0,1,2,960,5,6,960,7] > > I

Re: [Numpy-discussion] genloadtxt : last call

2008-12-10 Thread Christopher Barker
Pierre GM wrote: >>> 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.ma and numpy.records in numpy.lib.io ? As long as numpy.ma and numpy.records are, and will remain, part of the standard numpy distribution,

Re: [Numpy-discussion] Find index of repeated numbers in array

2008-12-10 Thread Sturla Molden
On 12/10/2008 5:38 PM, Ross Williamson wrote: > Hi Everyone > > I think I'm missing something really obvious but what I would like to > do is extract the indexes from an array where a number matches - For > example > > data = [0,1,2,960,5,6,960,7] > > I would like to know, for example the in

[Numpy-discussion] ANNOUNCE: ETS 3.1.0 released!

2008-12-10 Thread Dave Peterson
I'm pleased to announce that the Enthought Tool Suite (ETS) 3.1.0 has been tagged, released, and uploaded to PyPi[1]! Both source distributions (.tar.gz) and binary (.egg) for Windows have been built and uploaded to PyPi. You can update an existing ETS install to v3.1.0 like so: easy_install

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

2008-12-10 Thread frank wang
I am running in ipython. Now I do not have the problem anymore. %reset commands is a good solution. Thanks Frank> Date: Tue, 9 Dec 2008 21:03:00 -0600> From: [EMAIL PROTECTED]> To: numpy-discussion@scipy.org> Subject: Re: [Numpy-discussion] how do I delete unused matrix to save the memory?>

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

2008-12-10 Thread frank wang
On my two systems with Intel Core2 DUO, finfo(float128) gives me the nameerro, "NameError: name 'float128' is not defined". Why? Thanks Frank> Date: Tue, 9 Dec 2008 21:10:32 -0600> From: [EMAIL PROTECTED]> To: numpy-discussion@scipy.org> Subject: Re: [Numpy-discussion] Importance of order w

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

2008-12-10 Thread Charles R Harris
On Wed, Dec 10, 2008 at 11:00 AM, frank wang <[EMAIL PROTECTED]> wrote: > On my two systems with Intel Core2 DUO, finfo(float128) gives me the > nameerro, "NameError: name 'float128' is not defined". Why? > > You probably run a 32 bit OS. IEEE extended precision is 80 bits. On 32 bit systems it

Re: [Numpy-discussion] Find index of repeated numbers in array

2008-12-10 Thread Ross Williamson
Thanks all I was being dumb and forgot to initialize as array() Cheers Ross On Dec 10, 2008, at 11:47 AM, Sturla Molden wrote: > On 12/10/2008 5:38 PM, Ross Williamson wrote: >> Hi Everyone >> >> I think I'm missing something really obvious but what I would like to >> do is extract the indexes

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

2008-12-10 Thread Robert Kern
On Wed, Dec 10, 2008 at 12:07, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > On Wed, Dec 10, 2008 at 11:00 AM, frank wang <[EMAIL PROTECTED]> wrote: >> >> On my two systems with Intel Core2 DUO, finfo(float128) gives me the >> nameerro, "NameError: name 'float128' is not defined". Why? >> > > Y

[Numpy-discussion] On the quality of the numpy.random.normal() distribution

2008-12-10 Thread Michael Gilbert
Hello, I have been reading that there may be potential issues with the Box-Muller transform, which is used by the numpy.random.normal() function. Supposedly, since f*x1 and f*x2 are not independent variables, then the individual elements (corresponding to f*x1 and f*x2 ) of the distribution

Re: [Numpy-discussion] On the quality of the numpy.random.normal() distribution

2008-12-10 Thread Matthieu Brucher
I think the use of a correct uniform generator will allow a good normal distribution. Congruental generators are very basic generators, everyone knows they should not be used. I think Numpy uses a Mersenne Twisted generator, for which you can generate "independant" vectors with several hundred valu

Re: [Numpy-discussion] On the quality of the numpy.random.normal() distribution

2008-12-10 Thread Pauli Virtanen
Wed, 10 Dec 2008 14:03:39 -0500, Michael Gilbert wrote: > I have been reading that there may be potential issues with the > Box-Muller transform, which is used by the numpy.random.normal() > function. Supposedly, since f*x1 and f*x2 are not independent > variables, then the individual elements

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

2008-12-10 Thread Charles R Harris
On Wed, Dec 10, 2008 at 11:58 AM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Wed, Dec 10, 2008 at 12:07, Charles R Harris > <[EMAIL PROTECTED]> wrote: > > > > > > On Wed, Dec 10, 2008 at 11:00 AM, frank wang <[EMAIL PROTECTED]> wrote: > >> > >> On my two systems with Intel Core2 DUO, finfo(float1

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

2008-12-10 Thread Charles R Harris
On Wed, Dec 10, 2008 at 11:58 AM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Wed, Dec 10, 2008 at 12:07, Charles R Harris > <[EMAIL PROTECTED]> wrote: > > > > > > On Wed, Dec 10, 2008 at 11:00 AM, frank wang <[EMAIL PROTECTED]> wrote: > >> > >> On my two systems with Intel Core2 DUO, finfo(float1

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

2008-12-10 Thread Peter Norton
On Wed, Dec 10, 2008 at 12:59 AM, David Cournapeau <[EMAIL PROTECTED]> wrote: > 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

Re: [Numpy-discussion] On the quality of the numpy.random.normal() distribution

2008-12-10 Thread Charles R Harris
On Wed, Dec 10, 2008 at 12:03 PM, Michael Gilbert < [EMAIL PROTECTED]> wrote: > Hello, > > I have been reading that there may be potential issues with the > Box-Muller transform, which is used by the numpy.random.normal() > function. Supposedly, since f*x1 and f*x2 are not independent variable

[Numpy-discussion] rollaxis and reshape

2008-12-10 Thread Elfnor
Hi I'm trying to split an array into two pieces and have the two pieces in a new dimension. Here it is in code, because that's hard to explain in words. >>>data.shape (4, 50, 3) >>>new_data = numpy.zeros((2, 4, 25, 3)) >>>new_data[0,...] = data[:,:25,:] >>>new_data[1,...] = data[:,25:,:] >>>ne

[Numpy-discussion] Failing to build numpy properly on Ubuntu Hardy

2008-12-10 Thread Gael Varoquaux
Hi all, Looks like I am following the long line of people failing to build numpy :). I must admit I am clueless with building problems. Numpy builds alright, but I get: ImportError: /usr/lib/sse2/atlas/libblas.so.3gf: undefined symbol: _gfortran_st_write_done On import. This used to work a whi

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

2008-12-10 Thread Bab Tei
Damian Eads soe.ucsc.edu> writes: > > 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 d

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

2008-12-10 Thread Bab Tei
Keith Goodman gmail.com> writes: > > On Tue, Dec 9, 2008 at 12:25 PM, Bab Tei yahoo.com> 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 i

Re: [Numpy-discussion] Failing to build numpy properly on Ubuntu Hardy

2008-12-10 Thread Gael Varoquaux
On Wed, Dec 10, 2008 at 11:10:23PM +0100, Gael Varoquaux wrote: > Numpy builds alright, but I get: > ImportError: /usr/lib/sse2/atlas/libblas.so.3gf: undefined symbol: > _gfortran_st_write_done Doh! I knew it must be a FAQ, and it was :). Better googling gave me the answer: the configuration was

Re: [Numpy-discussion] Failing to build numpy properly on Ubuntu Hardy

2008-12-10 Thread David Cournapeau
Gael Varoquaux wrote: > I must have at some point installed the gfortran libraries by mistake. I > was taken by surprise because I didn't expect Ubuntu to have 2 versions > of atlas, ABI incompatible. > The point was to help for transition from g77 to gfortran ABI. Intrepid does not have this p

Re: [Numpy-discussion] Failing to build numpy properly on Ubuntu Hardy

2008-12-10 Thread Gael Varoquaux
On Thu, Dec 11, 2008 at 01:07:51PM +0900, David Cournapeau wrote: > Gael Varoquaux wrote: > > I must have at some point installed the gfortran libraries by mistake. I > > was taken by surprise because I didn't expect Ubuntu to have 2 versions > > of atlas, ABI incompatible. > The point was to hel

Re: [Numpy-discussion] Failing to build numpy properly on Ubuntu Hardy

2008-12-10 Thread Grissiom
On Thu, Dec 11, 2008 at 06:10, Gael Varoquaux <[EMAIL PROTECTED] > wrote: > Hi all, > > Looks like I am following the long line of people failing to build numpy > :). I must admit I am clueless with building problems. > > Numpy builds alright, but I get: > > ImportError: /usr/lib/sse2/atlas/libbla

Re: [Numpy-discussion] Failing to build numpy properly on Ubuntu Hardy

2008-12-10 Thread David Cournapeau
Grissiom wrote: > On Thu, Dec 11, 2008 at 06:10, Gael Varoquaux > <[EMAIL PROTECTED] > > wrote: > > Hi all, > > Looks like I am following the long line of people failing to build > numpy > :). I must admit I am clueless with building problems. > > Numpy

Re: [Numpy-discussion] Failing to build numpy properly on Ubuntu Hardy

2008-12-10 Thread Grissiom
On Thu, Dec 11, 2008 at 15:13, David Cournapeau < [EMAIL PROTECTED]> wrote: > Grissiom wrote: > > I have encountered with such problem before. My solution is recompile > > the problem package(maybe atlas in your case) with -ff2c option passed > > to gfortran. > > This is a bad idea: it won't work