Re: [Numpy-discussion] caching large allocations on gnu/linux

2017-03-13 Thread Anne Archibald
On Mon, Mar 13, 2017 at 12:21 PM Julian Taylor < jtaylor.deb...@googlemail.com> wrote: Should it be agreed that caching is worthwhile I would propose a very > simple implementation. We only really need to cache a small handful of > array data pointers for the fast allocate deallocate cycle that ap

Re: [Numpy-discussion] float16/32: wrong number of digits?

2017-03-13 Thread Anne Archibald
On Mon, Mar 13, 2017 at 12:57 PM Eric Wieser wrote: > > `float(repr(a)) == a` is guaranteed for Python `float` > > And `np.float16(repr(a)) == a` is guaranteed for `np.float16`(and the same > is true up to `float128`, which can be platform-dependent). Your code > doesn't work because you're deser

Re: [Numpy-discussion] float16/32: wrong number of digits?

2017-03-09 Thread Anne Archibald
On Thu, Mar 9, 2017, 11:27 Nico Schlömer wrote: > Hi everyone, > > I wondered how to express a numpy float exactly in terms of format, and > found `%r` quite useful: `float(repr(a)) == a` is guaranteed for Python > `float`s. When trying the same thing with lower-precision Python floats, I > found

Re: [Numpy-discussion] Question about numpy.random.choice with probabilties

2017-01-23 Thread Anne Archibald
On Mon, Jan 23, 2017 at 3:34 PM Robert Kern wrote: > I don't object to some Notes, but I would probably phrase it more like we > are providing the standard definition of the jargon term "sampling without > replacement" in the case of non-uniform probabilities. To my mind (or more > accurately, wi

Re: [Numpy-discussion] Question about numpy.random.choice with probabilties

2017-01-23 Thread Anne Archibald
On Wed, Jan 18, 2017 at 4:13 PM Nadav Har'El wrote: > On Wed, Jan 18, 2017 at 4:30 PM, wrote: > > > > Having more sampling schemes would be useful, but it's not possible to > implement sampling schemes with impossible properties. > > > > BTW: sampling 3 out of 3 without replacement is even worse

Re: [Numpy-discussion] Fast vectorized arithmetic with ~32 significant digits under Numpy

2015-12-12 Thread Anne Archibald
On Fri, Dec 11, 2015, 18:04 David Cournapeau wrote: On Fri, Dec 11, 2015 at 4:22 PM, Anne Archibald wrote: Actually, GCC implements 128-bit floats in software and provides them as __float128; there are also quad-precision versions of the usual functions. The Intel compiler provides this as

Re: [Numpy-discussion] Fast vectorized arithmetic with ~32 significant digits under Numpy

2015-12-11 Thread Anne Archibald
Actually, GCC implements 128-bit floats in software and provides them as __float128; there are also quad-precision versions of the usual functions. The Intel compiler provides this as well, I think, but I don't think Microsoft compilers do. A portable quad-precision library might be less painful.

Re: [Numpy-discussion] Sign of NaN

2015-09-29 Thread Anne Archibald
IEEE 754 has signum(NaN)->NaN. So does np.sign on floating-point arrays. Why should it be different for object arrays? Anne P.S. If you want exceptions when NaNs appear, that's what np.seterr is for. -A On Tue, Sep 29, 2015 at 5:18 PM Freddy Rietdijk wrote: > I wouldn't know of any valid outpu

Re: [Numpy-discussion] Python needs goto

2015-09-25 Thread Anne Archibald
goto! and comefrom! Together with exceptions, threads, lambda, super, generators, and coroutines, all we're lacking is call-with-current-continuation for the full list of impenetrable control-flow constructs. Oh, and lisp-style resumable exception handling. (Suggested syntax: drop(exception, value)

Re: [Numpy-discussion] feature request - increment counter on write check

2015-09-11 Thread Anne Archibald
On Fri, Sep 11, 2015 at 3:20 PM Sebastian Berg wrote: > On Fr, 2015-09-11 at 13:10 +, Daniel Manson wrote: > > Originally posted as issue 6301 on github. > > > > > > Presumably any block of code that modifies an ndarray's buffer is > > wrapped in a (thread safe?) check of the writable flag. W

Re: [Numpy-discussion] Defining a white noise process using numpy

2015-08-27 Thread Anne Archibald
On Thu, Aug 27, 2015 at 12:51 AM Daniel Bliss wrote: Can anyone give me some advice for translating this equation into code > using numpy? > > eta(t) = lim(dt -> 0) N(0, 1/sqrt(dt)), > > where N(a, b) is a Gaussian random variable of mean a and variance b**2. > > This is a heuristic definition of

[Numpy-discussion] Development workflow (not git tutorial)

2015-08-13 Thread Anne Archibald
Hi, What is a sensible way to work on (modify, compile, and test) numpy? There is documentation about "contributing to numpy" at: http://docs.scipy.org/doc/numpy-dev/dev/index.html and: http://docs.scipy.org/doc/numpy-dev/dev/gitwash/development_workflow.html but these are entirely focused on usi

Re: [Numpy-discussion] DEP: Deprecate boolean array indices with non-matching shape #4353

2015-06-05 Thread Anne Archibald
On Fri, Jun 5, 2015 at 5:45 PM Sebastian Berg wrote: > On Fr, 2015-06-05 at 08:36 -0400, josef.p...@gmail.com wrote: > > > > > > > What is actually being deprecated? > > It looks like there are different examples. > > > > > > wrong length: Nathaniels first example above, where the mask is not >

Re: [Numpy-discussion] Backwards-incompatible improvements to numpy.random.RandomState

2015-05-24 Thread Anne Archibald
Do we want a deprecation-like approach, so that eventually people who want replicability will specify versions, and everyone else gets bug fixes and improvements? This would presumably take several major versions, but it might avoid people getting unintentionally trapped on this version. Incidenta

Re: [Numpy-discussion] supporting quad precision

2013-06-12 Thread Anne Archibald
On 9 June 2013 13:23, David Cournapeau wrote: > So it depends on the CPU, the OS and the compiler. Using long double > for anything else than compatibility (e.g. binary files) is often a > mistake IMO, and highly unportable. > Now this I have to comment on. Long double is highly questionable for

Re: [Numpy-discussion] supporting quad precision

2013-06-08 Thread Anne Archibald
one could use a package like qd to provide portable quad precision (and quad-double). I'll take a look. Anne On Jun 5, 2013 7:10 PM, "David Cournapeau" wrote: > On Wed, Jun 5, 2013 at 5:21 PM, Charles R Harris > wrote: > > Hi Anne, > > > > Long time n

[Numpy-discussion] supporting quad precision

2013-06-05 Thread Anne Archibald
Hi folks, I recently came across an application I needed quad precision for (high-accuracy solution of a differential equation). I found a C++ library (odeint) that worked for the integration itself, but unfortunately it appears numpy is not able to work with quad precision arrays. For my applicat

Re: [Numpy-discussion] Efficient way to load a 1Gb file?

2011-08-10 Thread Anne Archibald
There was also some work on a semi-mutable array type that allowed appending along one axis, then 'freezing' to yield a normal numpy array (unfortunately I'm not sure how to find it in the mailing list archives). One could write such a setup by hand, using mmap() or realloc(), but I'd be inclined t

Re: [Numpy-discussion] [SciPy-User] recommendation for saving data

2011-08-01 Thread Anne Archibald
In astronomy we tend to use FITS, which is well-supported by pyfits, but a little limited. Some new instruments are beginning to use HDF5. All these generic formats allow very general data storage, so you will need to come up with a standrdized way to represent your own data. Used well, these form

Re: [Numpy-discussion] Can I index array starting with 1?

2011-07-28 Thread Anne Archibald
, implementation would be pretty easy - just make a subclass of ndarray that replaces the indexing function. Anne On 28 July 2011 19:26, Derek Homeier wrote: > On 29.07.2011, at 1:19AM, Stéfan van der Walt wrote: > >> On Thu, Jul 28, 2011 at 4:10 PM, Anne Archibald >> wrote: &g

Re: [Numpy-discussion] Can I index array starting with 1?

2011-07-28 Thread Anne Archibald
Don't forget the everything-looks-like-a-nail approach: make all your arrays one bigger than you need and ignore element zero. Anne On 7/28/11, Stéfan van der Walt wrote: > Hi Jeremy > > On Thu, Jul 28, 2011 at 3:19 PM, Jeremy Conlin wrote: >> I have a need to index my array(s) starting with a

Re: [Numpy-discussion] Quaternion dtype for NumPy - initial implementation available

2011-07-16 Thread Anne Archibald
What a useful package! Apart from helping all the people who know they need quaternions, this package removes one major family of use cases for vectorized small-matrix operations, namely, 3D rotations. Quaternions are the canonical way to represent orientation and rotation in three dimensions, and

Re: [Numpy-discussion] Numeric integration of higher order integrals

2011-06-01 Thread Anne Archibald
When the dimensionality gets high, grid methods like you're describing start to be a problem ("the curse of dimensionality"). The standard approaches are simple Monte Carlo integration or its refinements (Metropolis-Hasings, for example). These converge somewhat slowly, but are not much affected by

Re: [Numpy-discussion] RFC: Detecting array changes (NumPy 2.0?)

2011-03-11 Thread Anne Archibald
On 11 March 2011 15:34, Charles R Harris wrote: > > On Fri, Mar 11, 2011 at 1:06 PM, Dag Sverre Seljebotn > wrote: >> >> On Fri, 11 Mar 2011 19:37:42 + (UTC), Pauli Virtanen >> wrote: >> > On Fri, 11 Mar 2011 11:47:58 -0700, Charles R Harris wrote: >> > [clip] >> >> What about views? Would

Re: [Numpy-discussion] ragged array implimentation

2011-03-07 Thread Anne Archibald
On 7 March 2011 15:29, Christopher Barker wrote: > On 3/7/11 11:18 AM, Francesc Alted wrote: > >> but, instead of returning a numpy array of 'object' elements, plain >> python lists are returned instead. > > which gives you the append option -- I can see how that would be > usefull. Though I'd kin

Re: [Numpy-discussion] sample without replacement

2010-12-21 Thread Anne Archibald
I know this question came up on the mailing list some time ago (19/09/2008), and the conclusion was that yes, you can do it more or less efficiently in pure python; the trick is to use two different methods. If your sample is more than, say, a quarter the size of the set you're drawing from, you pe

Re: [Numpy-discussion] Solving Ax = b: inverse vs cholesky factorization

2010-11-08 Thread Anne Archibald
On 8 November 2010 14:38, Joon wrote: > Oh I see. So I guess in invA = solve(Ax, I) and then x = dot(invA, b) case, > there are more places where numerical errors occur, than just x = solve(Ax, > b) case. That's the heart of the matter, but one can be more specific. You can think of a matrix by

Re: [Numpy-discussion] Stacking a 2d array onto a 3d array

2010-10-28 Thread Anne Archibald
On 26 October 2010 21:02, Dewald Pieterse wrote: > I see my slicing was the problem, np.vstack((test[:1], test)) works > perfectly. Yes and no. np.newaxis (or "None" for short) is a very useful tool; you just stick it in an index expression and it adds an axis of length one there. If what you rea

Re: [Numpy-discussion] Assigning complex value to real array

2010-10-07 Thread Anne Archibald
On 7 October 2010 19:46, Andrew P. Mullhaupt wrote: > It wouldn't be the first time I suggested rewriting the select and > choose operations. I spent months trying to get Guido to let anything > more than slice indexing in arrays. And now, in the technologically > advanced future, we can index a

Re: [Numpy-discussion] Assigning complex value to real array

2010-10-07 Thread Anne Archibald
On 7 October 2010 13:01, Pauli Virtanen wrote: > to, 2010-10-07 kello 12:08 -0400, Andrew P. Mullhaupt kirjoitti: > [clip] >> No. You can define the arrays as backed by mapped files with real and >> imaginary parts separated. Then the imaginary part, being initially >> zero, is a sparse part of th

Re: [Numpy-discussion] A proposed change to rollaxis() behavior for negative 'start' values

2010-09-23 Thread Anne Archibald
On 23 September 2010 02:20, Ralf Gommers wrote: > > > On Wed, Sep 22, 2010 at 4:14 AM, Anne Archibald > wrote: >> >> Hi Ken, >> >> This is a tricky one. The current behaviour of rollaxis is to remove >> the requested axis from the list of axes and t

Re: [Numpy-discussion] Indexing and lookup issues

2010-09-22 Thread Anne Archibald
On 22 September 2010 16:38, Ross Williamson wrote: > Hi everyone > > I suspect this is easy but I'm stuck > > say I have a 1D array: > > t = [10,11,12] > > and a 2D array: > > id = [[0,1,0] > [0,2,0] > [2,0,2]] > > In could in IDL do y = t[id] which would produce: > > y = [[10,11,10] > [10,12,10]

Re: [Numpy-discussion] slicing / indexing question

2010-09-22 Thread Anne Archibald
On 21 September 2010 19:20, Timothy W. Hilton wrote: > I have an 80x1200x1200 nd.array of floats this_par.  I have a > 1200x1200 boolean array idx, and an 80-element float array pars.  For > each element of idx that is True, I wish to replace the corresponding > 80x1x1 slice of this_par with the

Re: [Numpy-discussion] A proposed change to rollaxis() behavior for negative 'start' values

2010-09-21 Thread Anne Archibald
Hi Ken, This is a tricky one. The current behaviour of rollaxis is to remove the requested axis from the list of axes and then insert it before the axis specified. This is exactly how python's list insertion works: In [1]: a = range(10) In [3]: a.insert(-1,'a') In [4]: a Out[4]: [0, 1, 2, 3, 4,

Re: [Numpy-discussion] restrictions on fancy indexing

2010-09-17 Thread Anne Archibald
On 17 September 2010 13:47, Neal Becker wrote: > It's nice I can do: > > f = np.linspace (0, 1, 100) > u[f<.1] = 0 > > cool, this seems to work also: > > u[np.abs(f)<.1] = 0 > > cool!  But exactly what kind of expressions are possible here?  Certainly > not arbitrary code. The short answer is, an

Re: [Numpy-discussion] IEEE 754-2008 decimal floating point support

2010-09-08 Thread Anne Archibald
On 8 September 2010 16:33, Robert Kern wrote: > On Wed, Sep 8, 2010 at 15:10, Michael Gilbert > wrote: >> On Wed, 8 Sep 2010 15:04:17 -0500, Robert Kern wrote: >>> On Wed, Sep 8, 2010 at 14:44, Michael Gilbert >>> wrote: > >>> > Just wanted to say that numpy object arrays + decimal solved all of

Re: [Numpy-discussion] indexing with booleans without making a copy?

2010-09-08 Thread Anne Archibald
2010/9/8 Ernest Adrogué : > I have a sorted, flat array: > > In [139]: a =np.array([0,1,2,2,2,3]) > > Basically, I want views of the areas where there > are repeated numbers (since the array is sorted, they > will be contiguous). > > But, of course, to find the numbers that are repeated > I have to

Re: [Numpy-discussion] test if two arrays share the same data

2010-09-05 Thread Anne Archibald
2010/9/5 Ernest Adrogué : >  5/09/10 @ 15:59 (-0500), thus spake Robert Kern: >> 2010/9/5 Ernest Adrogué : >> >  5/09/10 @ 21:25 (+0200), thus spake Gael Varoquaux: >> >> On Sun, Sep 05, 2010 at 09:12:34PM +0200, Ernest Adrogué wrote: >> >> > Hi, >> >> >> >> > How can it be done? >> >> >> >> np.may

Re: [Numpy-discussion] Array slices and number of dimensions

2010-09-01 Thread Anne Archibald
On 1 September 2010 17:54, Thomas Robitaille wrote: > Hi, > > I'm trying to extract sub-sections of a multidimensional array while keeping > the number of dimensions the same. If I just select a specific element along > a given direction, then the number of dimensions goes down by one: > im

Re: [Numpy-discussion] inversion of large matrices

2010-08-31 Thread Anne Archibald
Hi Melissa, On 30 August 2010 17:42, Melissa Mendonça wrote: > I've been lurking for a while here but never really introduced myself. > I'm a mathematician in Brazil working with optimization and numerical > analysis and I'm looking into scipy/numpy basically because I want to > ditch matlab. W

Re: [Numpy-discussion] Boolean arrays

2010-08-27 Thread Anne Archibald
On 27 August 2010 16:17, Robert Kern wrote: > On Fri, Aug 27, 2010 at 15:10, Ken Watford wrote: >> On Fri, Aug 27, 2010 at 3:58 PM, Brett Olsen wrote: >>> Hello, >>> >>> I have an array of non-numeric data, and I want to create a boolean >>> array denoting whether each element in this array is a

Re: [Numpy-discussion] np.asfortranarray: unnecessary copying?

2010-07-30 Thread Anne Archibald
This seems to me to be a bug, or rather, two bugs. 1D arrays are automatically Fortran-ordered, so isfortran should return True for them (incidentally, the documentation should be edited to indicate that the data must also be contiguous in memory). Whether or not this change is made, there's no poi

Re: [Numpy-discussion] Array concatenation performance

2010-07-15 Thread Anne Archibald
On 15 July 2010 13:38, Sturla Molden wrote: > Sorry for the previous mispost. > > This thread remids me of something I've though about for a while: Would > NumPy benefit from an np.ndarraylist subclass of np.ndarray, that has an > O(1) amortized append like Python lists? (Other methods of Python l

Re: [Numpy-discussion] 3 dim array unpacking

2010-07-12 Thread Anne Archibald
On 12 July 2010 13:24, K.-Michael Aye wrote: > Dear numpy hackers, > > I can't find the syntax for unpacking the 3 dimensions of a rgb array. > so i have a MxNx3 image array 'img' and would like to do: > > red, green, blue = img[magical_slicing] > > Which slicing magic do I need to apply? Not sli

Re: [Numpy-discussion] numpy.load raising IOError but EOFError expected

2010-06-28 Thread Anne Archibald
On 28 June 2010 10:52, Ruben Salvador wrote: > Sorry I had no access during these days. > > Thanks for the answer Friedrich, I had already checked numpy.savez, but > unfortunately I cannot make use of it. I don't have all the data needed to > be saved at the same time...it is produced each time I

Re: [Numpy-discussion] Solving a NLLSQ Problem by Pieces?

2010-06-26 Thread Anne Archibald
The basic problem with nonlinear least squares fitting, as with other nonlinear minimization problems, is that the standard algorithms find only a local minimum. It's easy to miss the global minimum and instead settle on a local minimum that is in fact a horrible fit. To deal with this, there are

Re: [Numpy-discussion] Ufunc memory access optimization

2010-06-15 Thread Anne Archibald
On 15 June 2010 11:16, Pauli Virtanen wrote: > ti, 2010-06-15 kello 10:10 -0400, Anne Archibald kirjoitti: >> Correct me if I'm wrong, but this code still doesn't seem to make the >> optimization of flattening arrays as much as possible. The array you >> get ou

Re: [Numpy-discussion] Ufunc memory access optimization

2010-06-15 Thread Anne Archibald
Correct me if I'm wrong, but this code still doesn't seem to make the optimization of flattening arrays as much as possible. The array you get out of np.zeros((100,100)) can be iterated over as an array of shape (1,), which should yield very substantial speedups. Since most arrays one operates

Re: [Numpy-discussion] NumPy re-factoring project

2010-06-11 Thread Anne Archibald
On 11 June 2010 11:12, Benjamin Root wrote: > > > On Fri, Jun 11, 2010 at 8:31 AM, Sturla Molden wrote: >> >> >> It would also make sence to evaluate expressions like "y = b*x + a" >> without a temporary array for b*x. I know roughly how to do it, but >> don't have time to look at it before next

Re: [Numpy-discussion] C vs. Fortran order -- misleading documentation?

2010-06-08 Thread Anne Archibald
On 8 June 2010 17:17, David Goldsmith wrote: > On Tue, Jun 8, 2010 at 1:56 PM, Benjamin Root wrote: >> >> On Tue, Jun 8, 2010 at 1:36 PM, Eric Firing wrote: >>> >>> On 06/08/2010 08:16 AM, Eric Firing wrote: >>> > On 06/08/2010 05:50 AM, Charles R Harris wrote: >>> >> >>> >> On Tue, Jun 8, 2010

Re: [Numpy-discussion] C vs. Fortran order -- misleading documentation?

2010-06-08 Thread Anne Archibald
On 8 June 2010 14:16, Eric Firing wrote: > On 06/08/2010 05:50 AM, Charles R Harris wrote: >> >> >> On Tue, Jun 8, 2010 at 9:39 AM, David Goldsmith > > wrote: >> >> On Tue, Jun 8, 2010 at 8:27 AM, Pavel Bazant > > wrote: >> >> >>

Re: [Numpy-discussion] numpy.savez does /not/ compress!?

2010-06-08 Thread Anne Archibald
On 8 June 2010 06:11, Pauli Virtanen wrote: > ti, 2010-06-08 kello 12:03 +0200, Hans Meine kirjoitti: >> On Tuesday 08 June 2010 11:40:59 Scott Sinclair wrote: >> > The savez docstring should probably be clarified to provide this >> > information. >> >> I would prefer to actually offer compression

Re: [Numpy-discussion] "Dynamic convolution" in Numpy

2010-06-06 Thread Anne Archibald
On 6 June 2010 04:44, David Cournapeau wrote: > On Thu, Jun 3, 2010 at 7:49 PM, arthur de conihout > wrote: > >> I don't know if i made myself very clear. >> if anyone has suggestions or has already operated a dynamic filtering i >> would be well interested. > > Does fade-in/fade-out actually wor

Re: [Numpy-discussion] Numerical Recipes (for Python)?

2010-06-04 Thread Anne Archibald
ck the ones I need. Python of course. Read the scipy documentation. Anne > > On 6/3/2010 11:09 PM, Anne Archibald wrote: >> On 4 June 2010 00:24, Wayne Watson wrote: >> >>> The link below leads me to http://numpy.scipy.org/, with or without the >>> whatever. I

Re: [Numpy-discussion] Numerical Recipes (for Python)?

2010-06-03 Thread Anne Archibald
thon, scipy itself is pretty much a library providing what's in NR. Anne > On 6/1/2010 9:04 PM, Anne Archibald wrote: >> On 2 June 2010 00:33, Wayne Watson  wrote: >> >>> Subject is a book title from some many years ago, I wonder if it ever >>> got to Python

Re: [Numpy-discussion] Numerical Recipes (for Python)?

2010-06-01 Thread Anne Archibald
On 2 June 2010 00:33, Wayne Watson wrote: > Subject is a book title from some many years ago, I wonder if it ever > got to Python? I know there were C and Fortran versions. There is no Numerical Recipes for python. The main reason there isn't a NR for python is that practically everything they di

Re: [Numpy-discussion] ix_ and copies

2010-05-30 Thread Anne Archibald
On 30 May 2010 11:25, Keith Goodman wrote: > On Sat, May 29, 2010 at 2:49 PM, Anne Archibald > wrote: >> On 29 May 2010 15:09, Robert Kern wrote: >>> On Sat, May 29, 2010 at 12:27, Keith Goodman wrote: >>>> Will making changes to arr2 never change arr1 if &g

Re: [Numpy-discussion] ix_ and copies

2010-05-29 Thread Anne Archibald
On 29 May 2010 15:09, Robert Kern wrote: > On Sat, May 29, 2010 at 12:27, Keith Goodman wrote: >> Will making changes to arr2 never change arr1 if >> >> arr2 = arr1[np.ix_(*lists)] >> >> where lists is a list of (index) lists? np.ix_ returns a tuple of >> arrays so I'm guessing (and hoping) the a

Re: [Numpy-discussion] Finding Star Images on a Photo (Video chip) Plate?

2010-05-28 Thread Anne Archibald
someone else's, but let me point out that reliably extracting source parameters from astronomical images is *hard* and requires cleverness, attention to countless special cases, troubleshooting, and experience. But it's an old problem, and astronomers have taken all of the needed things l

Re: [Numpy-discussion] Finding Star Images on a Photo (Video chip) Plate?

2010-05-28 Thread Anne Archibald
On 28 May 2010 21:09, Charles R Harris wrote: > > > On Fri, May 28, 2010 at 5:45 PM, Wayne Watson > wrote: >> >> Suppose I have a 640x480 pixel video chip and would like to find star >> images on it, possible planets and the moon. A possibility of noise >> exits, or bright pixels. Is there a know

Re: [Numpy-discussion] curious about how people would feel about moving to github

2010-05-27 Thread Anne Archibald
On 27 May 2010 04:43, Charles R Harris wrote: > >> Maybe most importantly, distributed revision control places any >> possible contributor on equal footing with those with commit access; >> this is one important step in making contributors feel valued. >> > > Well, not quite. They can't commit to

Re: [Numpy-discussion] curious about how people would feel about moving to github

2010-05-26 Thread Anne Archibald
On 27 May 2010 01:55, Matthew Brett wrote: > Hi, > >> Linux has Linus, ipython has Fernando, nipy has... well, I'm sure it is >> somebody. Numpy and Scipy no longer have a central figure and I like it that >> way. There is no reason that DVCS has to inevitably lead to a central >> authority. > > I

Re: [Numpy-discussion] curious about how people would feel about moving to github

2010-05-26 Thread Anne Archibald
On 27 May 2010 01:22, Charles R Harris wrote: > > > On Wed, May 26, 2010 at 9:49 PM, Jarrod Millman > wrote: >> >> On Wed, May 26, 2010 at 8:08 PM, Matthew Brett >> wrote: >> > That's the model we've gone for in nipy and ipython too.  We wrote it >> > up in a workflow doc project.  Here are the

Re: [Numpy-discussion] curious about how people would feel about moving to github

2010-05-26 Thread Anne Archibald
Hi Jarrod, I'm in favour of the switch, though I don't use Windows. I find git far more convenient to use than SVN; I've been using git-svn, and in spite of the headaches it's caused me I still prefer it to raw SVN. It seems to me that git's flexibility in how people collaborate means we can do a

Re: [Numpy-discussion] efficient way to manage a set of floats?

2010-05-12 Thread Anne Archibald
On 12 May 2010 20:09, Dr. Phillip M. Feldman wrote: > > > Warren Weckesser-3 wrote: >> >> A couple questions: >> >> How many floats will you be storing? >> >> When you test for membership, will you want to allow for a numerical >> tolerance, so that if the value 1 - 0.7 is added to the set, a test

Re: [Numpy-discussion] efficient way to manage a set of floats?

2010-05-10 Thread Anne Archibald
On 10 May 2010 21:56, Dr. Phillip M. Feldman wrote: > > > Anne Archibald-2 wrote: >> >> on a 32-bit machine, >> the space overhead is roughly a 32-bit object pointer or two for each >> float, plus about twice the number of floats times 32-bit pointers for >>

Re: [Numpy-discussion] efficient way to manage a set of floats?

2010-05-10 Thread Anne Archibald
On 10 May 2010 18:53, Dr. Phillip M. Feldman wrote: > > I have an application that involves managing sets of floats.  I can use > Python's built-in set type, but a data structure that is optimized for > fixed-size objects that can be compared without hashing should be more > efficient than a more

Re: [Numpy-discussion] Question about numpy.arange()

2010-05-02 Thread Anne Archibald
On 1 May 2010 16:36, Gökhan Sever wrote: > Hello, > > Is "b" an expected value? I am suspecting another floating point arithmetic > issue. > > I[1]: a = np.arange(1.6, 1.8, 0.1, dtype='float32') > > I[2]: a > O[2]: array([ 1.6002,  1.7005], dtype=float32) > > I[3]: b = np.arange(1.7, 1.8,

Re: [Numpy-discussion] proposing a "beware of [as]matrix()" warning

2010-04-28 Thread Anne Archibald
On 28 April 2010 14:30, Alan G Isaac wrote: > On 4/28/2010 12:08 PM, Dag Sverre Seljebotn wrote: >> it would be good to deprecate the matrix class >> from NumPy > > Please let us not have this discussion all over again. I think you may be too late on this, but it's worth a try. > The matrix clas

Re: [Numpy-discussion] Disabling Extended Precision in NumPy (like -ffloat-store)

2010-04-25 Thread Anne Archibald
On 21 April 2010 23:04, Adrien Guillon wrote: > Thank you for your questions... I'll answer them now. > > The motivation behind using Python and NumPy is to be able to "double > check" that the numerical algorithms work okay in an > engineer/scientist friendly language.  We're basically prototypin

Re: [Numpy-discussion] Aggregate memmap

2010-04-25 Thread Anne Archibald
On 21 April 2010 15:41, Matthew Turk wrote: > Hi there, > > I've quite a bit of unformatted fortran data that I'd like to use as > input to a memmap, as sort of a staging area for selection of > subregions to be loaded into RAM. Unfortunately, what I'm running > into is that the data was output a

Re: [Numpy-discussion] Disabling Extended Precision in NumPy (like -ffloat-store)

2010-04-21 Thread Anne Archibald
On 21 April 2010 11:03, Pauli Virtanen wrote: > ke, 2010-04-21 kello 10:47 -0400, Adrien Guillon kirjoitti: > [clip] >> My understanding, however, is that Intel processors may use extended >> precision for some operations anyways unless this is explicitly >> disabled, which is done with gcc via th

Re: [Numpy-discussion] binomial coefficient, factorial

2010-04-14 Thread Anne Archibald
On 14 April 2010 17:37, Christopher Barker wrote: > jah wrote: >> Is there any chance that a binomial coefficent and factorial function >> can make their way into NumPy? > > probably not -- numpy is over-populated already > >> I know these exist in Scipy, but I don't >> want to have to install Sci

Re: [Numpy-discussion] Find indices of largest elements

2010-04-14 Thread Anne Archibald
On 14 April 2010 16:56, Keith Goodman wrote: > On Wed, Apr 14, 2010 at 12:39 PM, Nikolaus Rath wrote: >> Keith Goodman writes: >>> On Wed, Apr 14, 2010 at 8:49 AM, Keith Goodman wrote: On Wed, Apr 14, 2010 at 8:16 AM, Nikolaus Rath wrote: > Hello, > > How do I best find out th

Re: [Numpy-discussion] How to combine a pair of 1D arrays?

2010-04-14 Thread Anne Archibald
On 14 April 2010 11:34, Robert Kern wrote: > On Wed, Apr 14, 2010 at 10:25, Peter Shinners wrote: >> Is there a way to combine two 1D arrays with the same size into a 2D >> array? It seems like the internal pointers and strides could be >> combined. My primary goal is to not make any copies of th

Re: [Numpy-discussion] Proposal for new ufunc functionality

2010-04-12 Thread Anne Archibald
On 12 April 2010 18:26, Travis Oliphant wrote: > We should collect all of these proposals into a NEP. Or several NEPs, since I think they are quasi-orthogonal. > To clarify what I > mean by "group-by" behavior. > Suppose I have an array of floats and an array of integers.   Each element > in th

Re: [Numpy-discussion] Best dtype for Boolean values

2010-04-12 Thread Anne Archibald
On 12 April 2010 11:59, John Jack wrote: > Hello all. > I am (relatively) new to python, and 100% new to numpy. > I need a way to store arrays of booleans and compare the arrays for > equality. > I assume I want arrays of dtype Boolean, and I should compare the arrays > with array_equal tmp.a

Re: [Numpy-discussion] Proposal for new ufunc functionality

2010-04-11 Thread Anne Archibald
2010/4/10 Stéfan van der Walt : > On 10 April 2010 19:45, Pauli Virtanen wrote: >> Another addition to ufuncs that should be though about is specifying the >> Python-side interface to generalized ufuncs. > > This is an interesting idea; what do you have in mind? I can see two different kinds of a

Re: [Numpy-discussion] Do ufuncs returned by frompyfunc() have the out arg?

2010-04-06 Thread Anne Archibald
On 6 April 2010 15:42, Ken Basye wrote: > Folks, > I hope this is a simple question. When I created a ufunc with > np.frompyfunc(), I got an error when I called the result with an 'out' > argument: In fact, ordinary ufuncs do not accept names for their arguments. This is annoying, but fixing it

Re: [Numpy-discussion] Bug in logaddexp2.reduce

2010-04-01 Thread Anne Archibald
On 1 April 2010 13:38, Charles R Harris wrote: > > > On Thu, Apr 1, 2010 at 8:37 AM, Charles R Harris > wrote: >> >> >> On Thu, Apr 1, 2010 at 12:46 AM, Anne Archibald >> wrote: >>> >>> On 1 April 2010 02:24, Charles R Harris >>>

Re: [Numpy-discussion] ufuncs on funny strides; also isnan, isfinite, etc on a variety of dtypes

2010-04-01 Thread Anne Archibald
On 1 April 2010 14:30, M Trumpis wrote: > Hi all, > > disclaimer: pardon my vast ignorance on the subject of ufuncs, that > will explain the naivety of the following questions > > This morning I was looking at this line of code, which was running > quite slow for me and making me think > > data_ha

Re: [Numpy-discussion] Bug in logaddexp2.reduce

2010-04-01 Thread Anne Archibald
On 1 April 2010 03:15, David Cournapeau wrote: > Anne Archibald wrote: > >> >> Particularly given the comments in the boost source code, I'm leery of >> this fix; who knows what an optimizing compiler will do with it? > > But the current code *is* wrong: it is n

Re: [Numpy-discussion] Bug in logaddexp2.reduce

2010-03-31 Thread Anne Archibald
On 1 April 2010 02:49, David Cournapeau wrote: > Charles R Harris wrote: >> On Thu, Apr 1, 2010 at 12:04 AM, Anne Archibald >> wrote: >> >>> On 1 April 2010 01:59, Charles R Harris wrote: >>>> >>>> On Wed, Mar 31, 2010 at 11:46 PM, Anne

Re: [Numpy-discussion] Bug in logaddexp2.reduce

2010-03-31 Thread Anne Archibald
On 1 April 2010 02:24, Charles R Harris wrote: > > > On Thu, Apr 1, 2010 at 12:04 AM, Anne Archibald > wrote: >> >> On 1 April 2010 01:59, Charles R Harris wrote: >> > >> > >> > On Wed, Mar 31, 2010 at 11:46 PM, Anne Archibald >> &g

Re: [Numpy-discussion] Bug in logaddexp2.reduce

2010-03-31 Thread Anne Archibald
On 1 April 2010 01:59, Charles R Harris wrote: > > > On Wed, Mar 31, 2010 at 11:46 PM, Anne Archibald > wrote: >> >> On 1 April 2010 01:40, Charles R Harris wrote: >> > >> > >> > On Wed, Mar 31, 2010 at 11:25 PM, wrote: >> >> >&

Re: [Numpy-discussion] Bug in logaddexp2.reduce

2010-03-31 Thread Anne Archibald
On 1 April 2010 01:40, Charles R Harris wrote: > > > On Wed, Mar 31, 2010 at 11:25 PM, wrote: >> >> On Thu, Apr 1, 2010 at 1:22 AM,   wrote: >> > On Thu, Apr 1, 2010 at 1:17 AM, Charles R Harris >> > wrote: >> >> >> >> >> >> On Wed, Mar 31, 2010 at 6:08 PM, wrote: >> >>> >> >>> On Wed, Mar 31,

Re: [Numpy-discussion] Bug in logaddexp2.reduce

2010-03-31 Thread Anne Archibald
On 1 April 2010 01:11, Charles R Harris wrote: > > > On Wed, Mar 31, 2010 at 11:03 PM, Anne Archibald > wrote: >> >> On 31 March 2010 16:21, Charles R Harris >> wrote: >> > >> > >> > On Wed, Mar 31, 2010 at 11:38 AM, T J wrote:

Re: [Numpy-discussion] Bug in logaddexp2.reduce

2010-03-31 Thread Anne Archibald
On 31 March 2010 16:21, Charles R Harris wrote: > > > On Wed, Mar 31, 2010 at 11:38 AM, T J wrote: >> >> On Wed, Mar 31, 2010 at 10:30 AM, T J wrote: >> > Hi, >> > >> > I'm getting some strange behavior with logaddexp2.reduce: >> > >> > from itertools import permutations >> > import numpy as np

Re: [Numpy-discussion] Interpolation question

2010-03-28 Thread Anne Archibald
On 27 March 2010 20:24, Andrea Gavana wrote: > Hi All, > >    I have an interpolation problem and I am having some difficulties > in tackling it. I hope I can explain myself clearly enough. > > Basically, I have a whole bunch of 3D fluid flow simulations (close to > 1000), and they are a result of

Re: [Numpy-discussion] Dealing with roundoff error

2010-03-28 Thread Anne Archibald
On 27 March 2010 19:38, Mike Sarahan wrote: > Hi all, > > I have run into some roundoff problems trying to line up some > experimental spectra.  The x coordinates are given in intervals of 0.1 > units.  I read the data in from a text file using np.loadtxt(). > > I think Robert's post here explains

Re: [Numpy-discussion] [OT] Starving CPUs article featured in IEEE's ComputingNow portal

2010-03-22 Thread Anne Archibald
On 22 March 2010 14:42, Pauli Virtanen wrote: > la, 2010-03-20 kello 17:36 -0400, Anne Archibald kirjoitti: >> I was in on that discussion. My recollection of the conclusion was >> that on the one hand they're useful, carefully applied, while on the >> other hand

Re: [Numpy-discussion] [OT] Starving CPUs article featured in IEEE's ComputingNow portal

2010-03-20 Thread Anne Archibald
On 20 March 2010 16:18, Sebastian Haase wrote: > On Sat, Mar 20, 2010 at 8:22 PM, Anne Archibald > wrote: >> On 20 March 2010 14:56, Dag Sverre Seljebotn >> wrote: >>> Pauli Virtanen wrote: >>>> Anne Archibald wrote: >>>>> I'm not

Re: [Numpy-discussion] [OT] Starving CPUs article featured in IEEE's ComputingNow portal

2010-03-20 Thread Anne Archibald
On 20 March 2010 14:56, Dag Sverre Seljebotn wrote: > Pauli Virtanen wrote: >> Anne Archibald wrote: >>> I'm not knocking numpy; it does (almost) the best it can. (I'm not >>> sure of the optimality of the order in which ufuncs are executed; I >>&g

Re: [Numpy-discussion] [OT] Starving CPUs article featured in IEEE's ComputingNow portal

2010-03-20 Thread Anne Archibald
On 20 March 2010 06:32, Francesc Alted wrote: > A Friday 19 March 2010 18:13:33 Anne Archibald escrigué: > [clip] >> What I didn't go into in detail in the article was that there's a >> trade-off of processing versus memory access available: we could >> reduce th

Re: [Numpy-discussion] [OT] Starving CPUs article featured in IEEE's ComputingNow portal

2010-03-19 Thread Anne Archibald
On 18 March 2010 13:53, Francesc Alted wrote: > A Thursday 18 March 2010 16:26:09 Anne Archibald escrigué: >> Speak for your own CPUs :). >> >> But seriously, congratulations on the wide publication of the article; >> it's an important issue we often don't thi

Re: [Numpy-discussion] [OT] Starving CPUs article featured in IEEE's ComputingNow portal

2010-03-18 Thread Anne Archibald
On 18 March 2010 09:57, Francesc Alted wrote: > Hi, > > Konrad Hinsen has just told me that my article "Why Modern CPUs Are Starving > and What Can Be Done About It", which has just released on the March/April > issue of "Computing in Science and Engineering", also made into this month's > free-ac

Re: [Numpy-discussion] matrix division without a loop

2010-03-12 Thread Anne Archibald
On 12 March 2010 13:54, gerardo.berbeglia wrote: > > Hello, > > I want to "divide" an n x n (2-dimension) numpy array matrix A by a n > (1-dimension) array d as follows: Look up "broadcasting" in the numpy docs. The short version is this: operations like division act elementwise on arrays of the

Re: [Numpy-discussion] arange including stop value?

2010-03-11 Thread Anne Archibald
On 11 March 2010 19:30, Tom K. wrote: > > > > davefallest wrote: >> >> ... >> In [3]: np.arange(1.01, 1.1, 0.01) >> Out[3]: array([ 1.01,  1.02,  1.03,  1.04,  1.05,  1.06,  1.07,  1.08, >> 1.09,  1.1 ]) >> >> Why does the ... np.arange command end up including my stop value? Don't use arange for

Re: [Numpy-discussion] fast duplicate of array

2010-01-23 Thread Anne Archibald
2010/1/23 Alan G Isaac : > On 1/23/2010 5:01 PM, Anne Archibald wrote: >> If both arrays are "C contiguous", or more generally contiguous blocks >> of memory with the same strided structure, you might get faster >> copying by flattening them first, so that it can go

Re: [Numpy-discussion] fast duplicate of array

2010-01-23 Thread Anne Archibald
2010/1/23 Alan G Isaac : > Suppose x and y are conformable 2d arrays. > I now want x to become a duplicate of y. > I could create a new array: > x = y.copy() > or I could assign the values of y to x: > x[:,:] = y > > As expected the latter is faster (no array creation). > Are there better ways? If

  1   2   3   4   5   >