Re: [Numpy-discussion] numpy 1:1.0.4: numpy.average() returns the wrong result with weights

2008-02-22 Thread Anne Archibald
On 22/02/2008, Travis E. Oliphant [EMAIL PROTECTED] wrote: Is there a ticket on the NumPy trac for this? We won't see it if there isn't. Thanks for pointing us to the bug. It appears to be fixed in SVN (that was quick!). But the Debian bug report also points out a peculiar unnecessary use

Re: [Numpy-discussion] Optimize speed of for loop using numpy

2008-02-26 Thread Anne Archibald
On 25/02/2008, Trond Kristiansen [EMAIL PROTECTED] wrote: I have attached the function that the FOR loop is part of as a python file. What I am trying to do is to create a set of functions that will read the output files (NetCDF) from running the ROMS model (ocean model). The output file

Re: [Numpy-discussion] contiguous true

2008-02-29 Thread Anne Archibald
On 01/03/2008, Charles R Harris [EMAIL PROTECTED] wrote: On Fri, Feb 29, 2008 at 10:53 AM, John Hunter [EMAIL PROTECTED] wrote: I have a boolean array and would like to find the lowest index ind where N contiguous elements are all True. Eg, if x is [...] Oops, ind = arange(len(x)). I

Re: [Numpy-discussion] numpy.correlate with phase offset 1D data series

2008-03-03 Thread Anne Archibald
On 03/03/2008, Ray Schumacher [EMAIL PROTECTED] wrote: I'm trying to figure out what numpy.correlate does, and, what are people using to calculate the phase shift of 1D signals? I use a hand-rolled Fourier-domain cross-correlation, but then, I'm using a Fourier-domain representation of my

Re: [Numpy-discussion] numpy.correlate with phase offset 1D data series

2008-03-03 Thread Anne Archibald
On 03/03/2008, Ray Schumacher [EMAIL PROTECTED] wrote: Xie's 2D algorithm reduced to 1D works nicely for computing the relative phase, but is it the fastest way? It might be, since some correlation algorithms use FFTs as well. What does _correlateND use, in scipy? Which way will be the

Re: [Numpy-discussion] Pickling and initializing

2008-03-03 Thread Anne Archibald
On 03/03/2008, Dinesh B Vadhia [EMAIL PROTECTED] wrote: When you pickle a numpy/scipy matrix does it have to be initialized by another program? For example: Most python objects do not need to be initialized. You just call a function that makes the one you want: l = range(10) This makes a

Re: [Numpy-discussion] argmin min on ndarrays

2008-03-04 Thread Anne Archibald
On 04/03/2008, Pierre GM [EMAIL PROTECTED] wrote: All, Let a b be two ndarrays of the same shape. I'm trying to find the elements of b that correspond to the minima of a along an arbitrary axis. The problem is trivial when axis=None or when a.ndim=2, but I'm getting confused with higher

Re: [Numpy-discussion] argmin min on ndarrays

2008-03-04 Thread Anne Archibald
On 04/03/2008, Pierre GM [EMAIL PROTECTED] wrote: Anne, Thanks a lot for your suggestion. Something like if axis is None: return b.flat[a.argmin()] else: return numpy.choose(a.argmin(axis),numpy.rollaxis(b,axis,0)) seems to do the trick fairly nicely indeed. The other

Re: [Numpy-discussion] Random int64 and float64 numbers

2009-11-02 Thread Anne Archibald
2009/11/1 Thomas Robitaille thomas.robitai...@gmail.com: Hi, I'm trying to generate random 64-bit integer values for integers and floats using Numpy, within the entire range of valid values for that type. To generate random 32-bit floats, I can use: Others have addressed why this is giving

Re: [Numpy-discussion] Random int64 and float64 numbers

2009-11-05 Thread Anne Archibald
2009/11/5 David Goldsmith d.l.goldsm...@gmail.com: On Thu, Nov 5, 2009 at 3:26 PM, David Warde-Farley d...@cs.toronto.edu wrote: On 5-Nov-09, at 4:54 PM, David Goldsmith wrote: Interesting thread, which leaves me wondering two things: is it documented somewhere (e.g., at the IEEE site)

Re: [Numpy-discussion] Random int64 and float64 numbers

2009-11-05 Thread Anne Archibald
2009/11/5 josef.p...@gmail.com: On Thu, Nov 5, 2009 at 10:42 PM, David Goldsmith d.l.goldsm...@gmail.com wrote: On Thu, Nov 5, 2009 at 3:26 PM, David Warde-Farley d...@cs.toronto.edu wrote: On 5-Nov-09, at 4:54 PM, David Goldsmith wrote: Interesting thread, which leaves me wondering two

Re: [Numpy-discussion] How to get rid of the loop?

2009-11-07 Thread Anne Archibald
2009/11/7 Stas K stanc...@gmail.com: Thank you, Josef It is exactly what I want: ar[:,None]**2 + ar**2 Do you know something about performance of this? In my real program ar  have ~ 10k elements, and expression for v more complicated (it has some trigonometric functions) The construction

Re: [Numpy-discussion] Use-case for np.choose

2009-11-07 Thread Anne Archibald
2009/11/7 David Goldsmith d.l.goldsm...@gmail.com: Hi, all!  I'm working to clarify the docstring for np.choose (Stefan pointed out to me that it is pretty unclear, and I agreed), and, now that (I'm pretty sure that) I've figured out what it does in its full generality (e.g., when the

Re: [Numpy-discussion] Use-case for np.choose

2009-11-07 Thread Anne Archibald
2009/11/7 David Goldsmith d.l.goldsm...@gmail.com: Thanks, Anne. On Sat, Nov 7, 2009 at 1:32 PM, Anne Archibald peridot.face...@gmail.com wrote: 2009/11/7 David Goldsmith d.l.goldsm...@gmail.com: snip Also, my experimenting suggests that the index array ('a', the first argument

Re: [Numpy-discussion] Use-case for np.choose

2009-11-08 Thread Anne Archibald
2009/11/8 josef.p...@gmail.com: On Sat, Nov 7, 2009 at 7:53 PM, David Goldsmith d.l.goldsm...@gmail.com wrote: Thanks, Anne. On Sat, Nov 7, 2009 at 1:32 PM, Anne Archibald peridot.face...@gmail.com wrote: 2009/11/7 David Goldsmith d.l.goldsm...@gmail.com: snip Also, my

Re: [Numpy-discussion] Use-case for np.choose

2009-11-08 Thread Anne Archibald
2009/11/8 David Goldsmith d.l.goldsm...@gmail.com: On Sat, Nov 7, 2009 at 11:59 PM, Anne Archibald peridot.face...@gmail.com wrote: 2009/11/7 David Goldsmith d.l.goldsm...@gmail.com: So in essence, at least as it presently functions, the shape of 'a' *defines* what the individual choices

Re: [Numpy-discussion] Use-case for np.choose

2009-11-08 Thread Anne Archibald
for your continued patience and tutelage. DG On Sun, Nov 8, 2009 at 5:36 AM, josef.p...@gmail.com wrote: On Sun, Nov 8, 2009 at 5:00 AM, David Goldsmith d.l.goldsm...@gmail.com wrote: On Sun, Nov 8, 2009 at 12:57 AM, Anne Archibald peridot.face...@gmail.com wrote: 2009/11/8 David

Re: [Numpy-discussion] Use-case for np.choose

2009-11-08 Thread Anne Archibald
2009/11/8 David Goldsmith d.l.goldsm...@gmail.com: On Sun, Nov 8, 2009 at 7:40 PM, Anne Archibald peridot.face...@gmail.com wrote: As Josef said, this is not correct. I think the key point of confusion is this: Do not pass choose two arrays. Pass it one array and a *list* of arrays

Re: [Numpy-discussion] finding close together points.

2009-11-10 Thread Anne Archibald
2009/11/10 Christopher Barker chris.bar...@noaa.gov: Hi all, I have a bunch of points in 2-d space, and I need to find out which pairs of points are within a certain distance of one-another (regular old Euclidean norm). This is an eminently reasonable thing to want, and KDTree should support

Re: [Numpy-discussion] finding close together points.

2009-11-12 Thread Anne Archibald
2009/11/12 Lou Pecora lou_boog2...@yahoo.com: - Original Message From: Christopher Barker chris.bar...@noaa.gov To: Discussion of Numerical Python numpy-discussion@scipy.org Sent: Thu, November 12, 2009 12:37:37 PM Subject: Re: [Numpy-discussion] finding close together points.

Re: [Numpy-discussion] finding close together points.

2009-11-12 Thread Anne Archibald
2009/11/11 Christopher Barker chris.bar...@noaa.gov: Anne Archibald wrote: 2009/11/10 Christopher Barker chris.bar...@noaa.gov: I have a bunch of points in 2-d space, and I need to find out which pairs of points are within a certain distance of one-another (regular old Euclidean norm

Re: [Numpy-discussion] finding close together points.

2009-11-13 Thread Anne Archibald
2009/11/13 Christopher Barker chris.bar...@noaa.gov: Anne Archibald wrote: 2009/11/10 Christopher Barker chris.bar...@noaa.gov: I have a bunch of points in 2-d space, and I need to find out which pairs of points are within a certain distance of one-another (regular old Euclidean norm

Re: [Numpy-discussion] Adding the new polynomial/chebyshev modules.

2009-11-16 Thread Anne Archibald
2009/11/16 Christopher Barker chris.bar...@noaa.gov: Charles R Harris wrote: I would like some advise on the best way to add the new functions. I've added a new package polynomial, and that package contains four new modules: chebyshev, polynomial, polytemplate, polyutils. This seems to

Re: [Numpy-discussion] finding close together points.

2009-11-16 Thread Anne Archibald
2009/11/16 Christopher Barker chris.bar...@noaa.gov: Anne Archibald wrote: 2009/11/13 Christopher Barker chris.bar...@noaa.gov: Wow! great -- you sounded interested, but I had no idea you'd run out and do it! thanks! we'll check it out. well, it turns out the Python version is unacceptably

Re: [Numpy-discussion] Adding the new polynomial/chebyshev modules.

2009-11-16 Thread Anne Archibald
2009/11/16 Robert Kern robert.k...@gmail.com: On Mon, Nov 16, 2009 at 18:05, Christopher Barker chris.bar...@noaa.gov wrote: Charles R Harris wrote: That's what I ended up doing. You still need to do import numpy.polynomial to get to them, they aren't automatically imported into the numpy

Re: [Numpy-discussion] Bytes vs. Unicode in Python3

2009-11-27 Thread Anne Archibald
2009/11/27 Christopher Barker chris.bar...@noaa.gov: The point is that I don't think we can just decide to use Unicode or Bytes in all places where PyString was used earlier. Agreed. I only half agree. It seems to me that for almost all situations where PyString was used, the right data type

Re: [Numpy-discussion] Computing Simple Statistics When Only they Frequency Distribution is Known

2009-11-28 Thread Anne Archibald
2009/11/28 Wayne Watson sierra_mtnv...@sbcglobal.net: I was only illustrating a way that I would not consider, since the hardware has already created the pdf. I've already coded it pretty much as you have suggested. As I think I mention ed above, I'm a bit surprised numpy doesn't provide the

Re: [Numpy-discussion] non-standard standard deviation

2009-11-29 Thread Anne Archibald
2009/11/29 Dr. Phillip M. Feldman pfeld...@verizon.net: All of the statistical packages that I am currently using and have used in the past (Matlab, Minitab, R, S-plus) calculate standard deviation using the sqrt(1/(n-1)) normalization, which gives a result that is unbiased when sampling from

Re: [Numpy-discussion] Computing Simple Statistics When Only they Frequency Distribution is Known

2009-11-29 Thread Anne Archibald
2009/11/28 Wayne Watson sierra_mtnv...@sbcglobal.net: Anne Archibald wrote: 2009/11/28 Wayne Watson sierra_mtnv...@sbcglobal.net: I was only illustrating a way that I would not consider, since the hardware has already created the pdf. I've already coded it pretty much as you have suggested

Re: [Numpy-discussion] convert strides/shape/offset into nd index?

2009-11-30 Thread Anne Archibald
2009/11/30 James Bergstra bergs...@iro.umontreal.ca: Your question involves a few concepts: - an integer vector describing the position of an element - the logical shape (another int vector) - the physical strides (another int vector) Ignoring the case of negative offsets, a physical

Re: [Numpy-discussion] Find the N maximum values and corresponding indexes in an array

2009-12-02 Thread Anne Archibald
2009/12/2 Keith Goodman kwgood...@gmail.com: On Wed, Dec 2, 2009 at 5:09 PM, Neal Becker ndbeck...@gmail.com wrote: David Warde-Farley wrote: On 2-Dec-09, at 6:55 PM, Howard Chong wrote: def myFindMaxA(myList):    implement finding maximum value with for loop iteration    maxIndex=0    

Re: [Numpy-discussion] Find the N maximum values and corresponding indexes in an array

2009-12-02 Thread Anne Archibald
2009/12/2 David Warde-Farley d...@cs.toronto.edu: On 2-Dec-09, at 8:09 PM, Neal Becker wrote: Not bad, although I wonder whether a partial sort could be faster. Probably (if the array is large) but depending on n, not if it's in Python. Ideal problem for Cython, though. How is Cython

Re: [Numpy-discussion] Find the N maximum values and corresponding indexes in an array

2009-12-02 Thread Anne Archibald
2009/12/2 Keith Goodman kwgood...@gmail.com: On Wed, Dec 2, 2009 at 5:27 PM, Anne Archibald peridot.face...@gmail.com wrote: 2009/12/2 Keith Goodman kwgood...@gmail.com: On Wed, Dec 2, 2009 at 5:09 PM, Neal Becker ndbeck...@gmail.com wrote: David Warde-Farley wrote: On 2-Dec-09, at 6:55 PM

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

2009-12-09 Thread Anne Archibald
2009/12/9 Dr. Phillip M. Feldman pfeld...@verizon.net: Pauli Virtanen-3 wrote: Nevertheless, I can't really regard dropping the imaginary part a significant issue. I am amazed that anyone could say this.  For anyone who works with Fourier transforms, or with electrical circuits, or with

Re: [Numpy-discussion] Repeated dot products

2009-12-12 Thread Anne Archibald
2009/12/12 T J tjhn...@gmail.com: Hi, Suppose I have an array of shape:  (n, k, k).  In this case, I have n k-by-k matrices.  My goal is to compute the product of a (potentially large) user-specified selection (with replacement) of these matrices. For example,   x =

Re: [Numpy-discussion] no ordinary Bessel functions?

2009-12-15 Thread Anne Archibald
2009/12/14 Dr. Phillip M. Feldman pfeld...@verizon.net: When I issue the command np.lookfor('bessel') I get the following: Search results for 'bessel' --- numpy.i0    Modified Bessel function of the first kind, order 0. numpy.kaiser    Return the Kaiser window.

Re: [Numpy-discussion] [AstroPy] Rotating and Transforming Vectors--Flight Path of a Celestial Body

2009-12-17 Thread Anne Archibald
2009/12/18 Wayne Watson sierra_mtnv...@sbcglobal.net: It's starting to come back to me. I found a few old graphics books that get into transformation matrices and such. Yes, earth centered. I ground out some code with geometry and trig that at least gets the first point on the path right. I

Re: [Numpy-discussion] dot function or dot notation, matrices, arrays?

2009-12-22 Thread Anne Archibald
2009/12/21 David Goldsmith d.l.goldsm...@gmail.com: On Mon, Dec 21, 2009 at 9:57 AM, Christopher Barker chris.bar...@noaa.gov wrote: Dag Sverre Seljebotn wrote: I recently got motivated to get better linear algebra for Python; wonderful! To me that seems like the ideal way to split up code

Re: [Numpy-discussion] LA improvements (was: dot function or dot notation, matrices, arrays?)

2009-12-23 Thread Anne Archibald
2009/12/23 David Goldsmith d.l.goldsm...@gmail.com: Starting a new thread for this. On Tue, Dec 22, 2009 at 7:13 PM, Anne Archibald peridot.face...@gmail.com wrote: I think we have one major lacuna: vectorized linear algebra. If I have to solve a whole whack of four-dimensional linear

Re: [Numpy-discussion] LA improvements (was: dot function or dot notation, matrices, arrays?)

2009-12-23 Thread Anne Archibald
2009/12/23 David Warde-Farley d...@cs.toronto.edu: On 23-Dec-09, at 10:34 AM, Anne Archibald wrote: The key idea would be that the linear algebra dimensions would always be the last one(s); this is fairly easy to arrange with rollaxis when it isn't already true, would tend to reduce copying

Re: [Numpy-discussion] Efficient orthogonalisation with scipy/numpy

2010-01-19 Thread Anne Archibald
2010/1/19 Gael Varoquaux gael.varoqu...@normalesup.org: For the google-completness of this thread, to get a speed gain, one needs to use the 'econ=True' flag to qr. Be warned that in some installations (in particular some using ATLAS), supplying econ=True can cause a segfault under certain

Re: [Numpy-discussion] Efficient orthogonalisation with scipy/numpy

2010-01-19 Thread Anne Archibald
2010/1/19 Charles R Harris charlesr.har...@gmail.com: Note that if you apply the QR algorithm to a Vandermonde matrix with the columns properly ordered you can get a collection of graded orthogonal polynomials over a given set of points. Or, if you want the polynomials in some other

Re: [Numpy-discussion] fast duplicate of array

2010-01-23 Thread Anne Archibald
2010/1/23 Alan G Isaac ais...@american.edu: 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

Re: [Numpy-discussion] fast duplicate of array

2010-01-23 Thread Anne Archibald
2010/1/23 Alan G Isaac ais...@american.edu: 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 in a single memcpy

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

2010-03-11 Thread Anne Archibald
On 11 March 2010 19:30, Tom K. t...@kraussfamily.org 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

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

2010-03-12 Thread Anne Archibald
On 12 March 2010 13:54, gerardo.berbeglia gberbeg...@gmail.com 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

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 fal...@pytables.org 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

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 fal...@pytables.org 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 think enough about. I'm just

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 fal...@pytables.org 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 the memory load

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 da...@student.matnat.uio.no 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 think some optimizations

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 seb.ha...@gmail.com wrote: On Sat, Mar 20, 2010 at 8:22 PM, Anne Archibald peridot.face...@gmail.com wrote: On 20 March 2010 14:56, Dag Sverre Seljebotn da...@student.matnat.uio.no wrote: Pauli Virtanen wrote: Anne Archibald wrote: I'm not knocking

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 p...@iki.fi 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 they're very difficult

Re: [Numpy-discussion] Dealing with roundoff error

2010-03-28 Thread Anne Archibald
On 27 March 2010 19:38, Mike Sarahan msara...@gmail.com 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

Re: [Numpy-discussion] Interpolation question

2010-03-28 Thread Anne Archibald
On 27 March 2010 20:24, Andrea Gavana andrea.gav...@gmail.com 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

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

2010-03-31 Thread Anne Archibald
On 31 March 2010 16:21, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Mar 31, 2010 at 11:38 AM, T J tjhn...@gmail.com wrote: On Wed, Mar 31, 2010 at 10:30 AM, T J tjhn...@gmail.com wrote: Hi, I'm getting some strange behavior with logaddexp2.reduce: from itertools import

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

2010-03-31 Thread Anne Archibald
On 1 April 2010 01:11, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Mar 31, 2010 at 11:03 PM, Anne Archibald peridot.face...@gmail.com wrote: On 31 March 2010 16:21, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Mar 31, 2010 at 11:38 AM, T J tjhn...@gmail.com

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

2010-03-31 Thread Anne Archibald
On 1 April 2010 01:40, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Mar 31, 2010 at 11:25 PM, josef.p...@gmail.com wrote: On Thu, Apr 1, 2010 at 1:22 AM,  josef.p...@gmail.com wrote: On Thu, Apr 1, 2010 at 1:17 AM, Charles R Harris charlesr.har...@gmail.com wrote: On

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

2010-04-01 Thread Anne Archibald
On 1 April 2010 01:59, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Mar 31, 2010 at 11:46 PM, Anne Archibald peridot.face...@gmail.com wrote: On 1 April 2010 01:40, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Mar 31, 2010 at 11:25 PM, josef.p...@gmail.com

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

2010-04-01 Thread Anne Archibald
On 1 April 2010 02:24, Charles R Harris charlesr.har...@gmail.com wrote: On Thu, Apr 1, 2010 at 12:04 AM, Anne Archibald peridot.face...@gmail.com wrote: On 1 April 2010 01:59, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Mar 31, 2010 at 11:46 PM, Anne Archibald

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

2010-04-01 Thread Anne Archibald
On 1 April 2010 02:49, David Cournapeau da...@silveregg.co.jp wrote: Charles R Harris wrote: On Thu, Apr 1, 2010 at 12:04 AM, Anne Archibald peridot.face...@gmail.comwrote: On 1 April 2010 01:59, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Mar 31, 2010 at 11:46 PM, Anne

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

2010-04-01 Thread Anne Archibald
On 1 April 2010 03:15, David Cournapeau da...@silveregg.co.jp 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 not true that u == 1

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 mtrum...@berkeley.edu 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

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

2010-04-01 Thread Anne Archibald
On 1 April 2010 13:38, Charles R Harris charlesr.har...@gmail.com wrote: On Thu, Apr 1, 2010 at 8:37 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Thu, Apr 1, 2010 at 12:46 AM, Anne Archibald peridot.face...@gmail.com wrote: On 1 April 2010 02:24, Charles R Harris charlesr.har

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 kbas...@jhu.edu 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,

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

2010-04-11 Thread Anne Archibald
2010/4/10 Stéfan van der Walt ste...@sun.ac.za: On 10 April 2010 19:45, Pauli Virtanen p...@iki.fi 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

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

2010-04-12 Thread Anne Archibald
On 12 April 2010 11:59, John Jack itsmilesda...@gmail.com 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

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

2010-04-12 Thread Anne Archibald
On 12 April 2010 18:26, Travis Oliphant oliph...@enthought.com 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.  

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 robert.k...@gmail.com wrote: On Wed, Apr 14, 2010 at 10:25, Peter Shinners p...@shinners.org 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

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

2010-04-14 Thread Anne Archibald
On 14 April 2010 16:56, Keith Goodman kwgood...@gmail.com wrote: On Wed, Apr 14, 2010 at 12:39 PM, Nikolaus Rath nikol...@rath.org wrote: Keith Goodman kwgood...@gmail.com writes: On Wed, Apr 14, 2010 at 8:49 AM, Keith Goodman kwgood...@gmail.com wrote: On Wed, Apr 14, 2010 at 8:16 AM,

Re: [Numpy-discussion] binomial coefficient, factorial

2010-04-14 Thread Anne Archibald
On 14 April 2010 17:37, Christopher Barker chris.bar...@noaa.gov 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

Re: [Numpy-discussion] Aggregate memmap

2010-04-25 Thread Anne Archibald
On 21 April 2010 15:41, Matthew Turk matthewt...@gmail.com 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

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 ais...@american.edu 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

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

2010-05-02 Thread Anne Archibald
On 1 May 2010 16:36, Gökhan Sever gokhanse...@gmail.com 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 =

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 pfeld...@verizon.net 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

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 pfeld...@verizon.net 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 the table. Hello Anne, I'm

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 pfeld...@verizon.net 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

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

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 charlesr.har...@gmail.com wrote: On Wed, May 26, 2010 at 9:49 PM, Jarrod Millman mill...@berkeley.edu wrote: On Wed, May 26, 2010 at 8:08 PM, Matthew Brett matthew.br...@gmail.com wrote: That's the model we've gone for in nipy and ipython too.  We

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 matthew.br...@gmail.com 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

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 charlesr.har...@gmail.com 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

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 charlesr.har...@gmail.com wrote: On Fri, May 28, 2010 at 5:45 PM, Wayne Watson sierra_mtnv...@sbcglobal.net 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

Re: [Numpy-discussion] ix_ and copies

2010-05-29 Thread Anne Archibald
On 29 May 2010 15:09, Robert Kern robert.k...@gmail.com wrote: On Sat, May 29, 2010 at 12:27, Keith Goodman kwgood...@gmail.com 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

Re: [Numpy-discussion] ix_ and copies

2010-05-30 Thread Anne Archibald
On 30 May 2010 11:25, Keith Goodman kwgood...@gmail.com wrote: On Sat, May 29, 2010 at 2:49 PM, Anne Archibald aarch...@physics.mcgill.ca wrote: On 29 May 2010 15:09, Robert Kern robert.k...@gmail.com wrote: On Sat, May 29, 2010 at 12:27, Keith Goodman kwgood...@gmail.com wrote: Will making

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

2010-06-01 Thread Anne Archibald
On 2 June 2010 00:33, Wayne Watson sierra_mtnv...@sbcglobal.net 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

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

2010-06-04 Thread Anne Archibald
of python, 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 Watsonsierra_mtnv...@sbcglobal.net  wrote: Subject is a book title from some many years ago, I wonder if it ever got to Python? I know

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

2010-06-04 Thread Anne Archibald
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 Watsonsierra_mtnv...@sbcglobal.net wrote: The link below leads me to http://numpy.scipy.org/, with or without the whatever. IRAF is not mentioned on the home

Re: [Numpy-discussion] Dynamic convolution in Numpy

2010-06-06 Thread Anne Archibald
On 6 June 2010 04:44, David Cournapeau courn...@gmail.com wrote: On Thu, Jun 3, 2010 at 7:49 PM, arthur de conihout arthurdeconih...@gmail.com 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.

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

2010-06-08 Thread Anne Archibald
On 8 June 2010 06:11, Pauli Virtanen p...@iki.fi 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] C vs. Fortran order -- misleading documentation?

2010-06-08 Thread Anne Archibald
On 8 June 2010 14:16, Eric Firing efir...@hawaii.edu wrote: On 06/08/2010 05:50 AM, Charles R Harris wrote: On Tue, Jun 8, 2010 at 9:39 AM, David Goldsmith d.l.goldsm...@gmail.com mailto:d.l.goldsm...@gmail.com wrote: On Tue, Jun 8, 2010 at 8:27 AM, Pavel Bazant maxpla...@seznam.cz

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

2010-06-08 Thread Anne Archibald
On 8 June 2010 17:17, David Goldsmith d.l.goldsm...@gmail.com wrote: On Tue, Jun 8, 2010 at 1:56 PM, Benjamin Root ben.r...@ou.edu wrote: On Tue, Jun 8, 2010 at 1:36 PM, Eric Firing efir...@hawaii.edu wrote: On 06/08/2010 08:16 AM, Eric Firing wrote: On 06/08/2010 05:50 AM, Charles R Harris

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

2010-06-11 Thread Anne Archibald
On 11 June 2010 11:12, Benjamin Root ben.r...@ou.edu wrote: On Fri, Jun 11, 2010 at 8:31 AM, Sturla Molden stu...@molden.no 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

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] Ufunc memory access optimization

2010-06-15 Thread Anne Archibald
On 15 June 2010 11:16, Pauli Virtanen p...@iki.fi 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 out of np.zeros((100,100)) can

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] numpy.load raising IOError but EOFError expected

2010-06-28 Thread Anne Archibald
On 28 June 2010 10:52, Ruben Salvador rsalvador...@gmail.com 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

Re: [Numpy-discussion] 3 dim array unpacking

2010-07-12 Thread Anne Archibald
On 12 July 2010 13:24, K.-Michael Aye kmichael@gmail.com 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

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

Re: [Numpy-discussion] Boolean arrays

2010-08-27 Thread Anne Archibald
On 27 August 2010 16:17, Robert Kern robert.k...@gmail.com wrote: On Fri, Aug 27, 2010 at 15:10, Ken Watford kwatford+sc...@gmail.com wrote: On Fri, Aug 27, 2010 at 3:58 PM, Brett Olsen brett.ol...@gmail.com wrote: Hello, I have an array of non-numeric data, and I want to create a boolean

Re: [Numpy-discussion] inversion of large matrices

2010-08-31 Thread Anne Archibald
Hi Melissa, On 30 August 2010 17:42, Melissa Mendonça meliss...@gmail.com 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

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

2010-09-01 Thread Anne Archibald
On 1 September 2010 17:54, Thomas Robitaille thomas.robitai...@gmail.com 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

<    1   2   3   4   5   >