Re: [Numpy-discussion] slow numpy.clip ?

2006-12-18 Thread Eric Firing
David Cournapeau wrote: Hi, When trying to speed up some matplotlib routines with the matplotlib dev team, I noticed that numpy.clip is pretty slow: clip(data, m, M) is slower than a direct numpy implementation (that is data[datadata[data>M] = M; return data.copy()). My understanding is th

Re: [Numpy-discussion] slow numpy.clip ?

2006-12-18 Thread Eric Firing
David, I think my earlier post got lost in the exchange between you and Stefan, so I will reiterate the central point: numpy.clip *is* slow, in that an implementation using putmask is substantially faster: def fastclip(a, vmin, vmax): a = a.copy() putmask(a, a<=vmin, vmin)

Re: [Numpy-discussion] slow numpy.clip ?

2006-12-18 Thread Eric Firing
David Cournapeau wrote: > Eric Firing wrote: >> David, >> >> I think my earlier post got lost in the exchange between you and Stefan, >> so I will reiterate the central point: numpy.clip *is* slow, in that an >> implementation using putmask is substantially f

Re: [Numpy-discussion] Profiling numpy ? (parts written in C)

2006-12-19 Thread Eric Firing
John, The current version of __call__ already includes substantial speedups prompted by David's profiling, and if I understand correctly the present bottleneck is actually the numpy take function. That is not to say that other improvements can't be made, of course. Eric John Hunter wrote: >>

Re: [Numpy-discussion] test issue

2006-12-29 Thread Eric Firing
belinda thom wrote: > Hello, > > I've been going thru Dave Kuhlman's "SciPy Course Outline" (http:// > www.rexx.com/~dkuhlman/scipy_course_01.html) and found out about test > functions -- very cool. Except that on my end, not all tests pass > (appended below). Is this a problem for other peop

Re: [Numpy-discussion] test issue

2006-12-29 Thread Eric Firing
belinda thom wrote: > Eric, > > Thanks for the well-thought-out answers to some of my recent posts. > > I've been using: > > http://pythonmac.org/packages/py24-fat/index.html > > for installing scipy, numpy, and matplotlib, as I didn't feel as > confident installing things manually. > > Shou

Re: [Numpy-discussion] ANN: MaskedArray as a subclass of ndarray - followup

2007-01-17 Thread Eric Firing
Pierre GM wrote: > All, > I've updated this famous reimplementation of maskedarray I keep ranting about. [...] > I also put the file `timer_comparison.py`, that runs some unittests with each > implementation > (numpy.core.ma and maskedarray), and outputs the minimum times. > On my machine, there d

Re: [Numpy-discussion] Request for porting pycdf to NumPy

2007-02-09 Thread Eric Firing
I have been using Jeff Whitaker's netcdf4 interface with good results. I could not find the web page for it on a NOAA site--I think NOAA is reorganizing--but a search turned it up here. Maybe Jeff can provide a better link. http://netcdf4-python.googlecode.com/svn/trunk/docs/netCDF4-module.htm

Re: [Numpy-discussion] rant against from numpy import * / from pylab import *

2007-03-15 Thread Eric Firing
Sebastian Haase wrote: > Hi! > I use the wxPython PyShell. > I like especially the feature that when typing a module and then the > dot "." I get a popup list of all available functions (names) inside > that module. > > Secondly, I think it really makes code clearer when one can see where > a fun

Re: [Numpy-discussion] concatenating 1-D arrays to 2D

2007-03-22 Thread Eric Firing
Sebastian Haase wrote: > On 3/22/07, Stefan van der Walt <[EMAIL PROTECTED]> wrote: >> On Thu, Mar 22, 2007 at 08:13:22PM -0400, Brian Blais wrote: >>> Hello, >>> >>> I'd like to concatenate a couple of 1D arrays to make it a 2D array, with >>> two columns >>> (one for each of the original 1D arra

[Numpy-discussion] GC support

2007-03-29 Thread Eric Firing
Travis and others, In the course of trying to understand memory leaks in matplotlib I have been trying to understand a bit about the garbage collector. If I understand correctly, any container that can can hold references to other containers could lead to a reference cycle; if the container s

Re: [Numpy-discussion] isarray in numpy?

2007-03-30 Thread Eric Firing
Travis Oliphant wrote: > mark wrote: > >> Is there a way to check whether something is an array? >> It seems that >> >> > isinstance(a, numpy.ndarray) > > This will return True if a is an array or a sub-class. Watch out if you use numpy.ma; or use Pierre G-M's maskedarray instead (assuming y

Re: [Numpy-discussion] basic python questions

2007-04-04 Thread Eric Firing
Robert Kern wrote: > Bill Baxter wrote: >> On 4/5/07, Robert Kern <[EMAIL PROTECTED]> wrote: >>> Bill Baxter wrote: Ok, I got another hopefully easy question: Why this: class Point(object): ... Instead of the style that's used in the Python tutorial

Re: [Numpy-discussion] [SciPy-user] median filter with clipping

2007-05-17 Thread Eric Firing
Travis Oliphant wrote: [...] > I'm inclined to move his masked array over to ma wholesale. The fact > that Pierre sees it as his baby is very important to me. If it doesn't > have significant compatibility issues than I'm all for it. I'm mainly > interested in hearing how people actually usin

Re: [Numpy-discussion] [SciPy-user] median filter with clipping

2007-05-17 Thread Eric Firing
; problem ;). But I agree: switching may have some subtle consequences in > matplotlib (nothing that can't be quickly fiexed, however). What do Eric > Firing, John Hunter and the other mpl developer think ? I think this would be a good time to make the switch. We are going to be st

Re: [Numpy-discussion] masked arrays and record arrays

2007-06-13 Thread Eric Firing
I have made changes in matplotlib svn to facilitate experimentation with the maskedarray module; I hope this will speed up the process of testing it and incorporating it into numpy as a replacement for numpy.core.ma. mpl scripts now accept the switches --maskedarray and --ma to force the use of

Re: [Numpy-discussion] Logical Selector

2007-07-18 Thread Eric Firing
Robert Kern wrote: > Geoffrey Zhu wrote: >> Hi Everyone, >> >> I am finding that numpy cannot operate on boolean arrays. For example, >> the following does not work: >> >> x=3Darray([(1,2),(2,1),(3,1),(4,1)]) >> >> x[x[:,0]>x[:,1] and x[1:]>1,:] >> >> It gives me an syntax error: >> >>

Re: [Numpy-discussion] Downsampling a 2D array with min/max and nullvalues

2007-07-26 Thread Eric Firing
Ludwig, Masked arrays will do exactly what you want. You have your choice of the numpy.ma version or the external maskedarray class. Eric Ludwig M Brinckmann wrote: > Hi there, > > I have a 2D array of size, lets say 4 * 512, which I need to > downsample by a step of 4 in the y direction

Re: [Numpy-discussion] Bug with MA and reduce?

2007-07-27 Thread Eric Firing
Ludwig M Brinckmann wrote: > This is a follow-up to an earlier mail that reported a suspected bug in > the reduce/minimum operation of numpy.ma . > > I have tried the same code with the scipy sandbox maskedarray > implementation and that gives me the correct output. For comparis

Re: [Numpy-discussion] rant against from numpy import * / from pylab import *

2007-08-09 Thread Eric Firing
alltrue(x, axis=None, out=None) > # >>> #P.alltrue(x, axis=0) > > I'm using matplotlib with > __version__ = '0.90.0' > __revision__ = '$Revision: 3003 $' > __date__ = '$Date: 2007-02-06 22:24:06 -0500 (Tue, 06 Feb 2007) $' > &

[Numpy-discussion] fast putmask implementation

2007-08-16 Thread Eric Firing
In looking at maskedarray performance, I found that the filled() function or method is a bottleneck. I think it can be sped up by using putmask instead of indexed assignment, but I found that putmask itself is slower than it needs to be. So I followed David Cournapeau's example of fastclip an

Re: [Numpy-discussion] fast putmask implementation

2007-08-16 Thread Eric Firing
David Cournapeau wrote: On 8/17/07, Eric Firing <[EMAIL PROTECTED]> wrote: In looking at maskedarray performance, I found that the filled() function or method is a bottleneck. I think it can be sped up by using putmask instead of indexed assignment, but I found that putmask itself is

Re: [Numpy-discussion] fast putmask implementation

2007-08-16 Thread Eric Firing
David M. Cooke wrote: On Thu, Aug 16, 2007 at 04:39:02PM -1000, Eric Firing wrote: As far as I can see there is no way of using svn diff to deal with this automatically, so in the attached revision I have manually removed chunks resulting solely from whitespace. Is there a better way to

Re: [Numpy-discussion] fast putmask implementation

2007-08-16 Thread Eric Firing
David M. Cooke wrote: > On Thu, Aug 16, 2007 at 04:39:02PM -1000, Eric Firing wrote: >> As far as I can see there is no way of using svn diff to deal with >> this automatically, so in the attached revision I have manually removed >> chunks resulting solely from whitesp

Re: [Numpy-discussion] Maskedarray implementations

2007-08-25 Thread Eric Firing
Alexander Michael wrote: > Is there any documentation available for your maskedarray? I would > like to get a feel for the basics, like how do I take the dot product, > do elementwise multiplication, etc, with your implementation. > > Thanks, > Alex > __

Re: [Numpy-discussion] Maskedarray implementations

2007-08-25 Thread Eric Firing
Pierre GM wrote: > On Saturday 25 August 2007 12:50:38 Eric Firing wrote: >> Alexander Michael wrote: >>> Is there any documentation available for your maskedarray? >> Pierre wrote some notes about maskedarray here: >> http://projects.scipy.org/scipy/numpy/wiki/Ma

Re: [Numpy-discussion] Bug in resize method?

2007-08-29 Thread Eric Firing
Timothy Hochberg wrote: > > > On 8/29/07, *Charles R Harris* <[EMAIL PROTECTED] > > wrote: > > > I still don't see why the method is needed at all. Given the > conditions on the array, the only thing it buys you over the resize > function or a reshape is t

Re: [Numpy-discussion] confusion about min/max

2007-09-18 Thread Eric Firing
stefan wrote: > On Tue, 18 Sep 2007 13:07:29 +0200, Gael Varoquaux > <[EMAIL PROTECTED]> wrote: >> On Tue, Sep 18, 2007 at 10:33:29AM -, mark wrote: >>> Does that make sense? I know, I should probably use a.min() rather >>> than min(a), but why does min() not get imported on an import * ? >> Be

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

2007-09-21 Thread Eric Firing
Stuart Brorson wrote: > On Fri, 21 Sep 2007, Robert Kern wrote: >> Stuart Brorson wrote: > Is it NumPy's goal to be as compatible with Matlab as possible? No. >>> OK, so that's fair enough. But how about self-consistency? >>> I was thinking about this issue as I was biking home this eveni

Re: [Numpy-discussion] C-API Documentation?

2007-09-24 Thread Eric Firing
Thomas Schreiner wrote: > Hi, > > is there any more documentation about the numpy C API than the one at > http://projects.scipy.org/scipy/numpy/wiki/NumPyCAPI If you have not already done so, I recommend following the suggestion at the bottom of that page, and buying Travis's book (http://www.t

[Numpy-discussion] segfault

2007-11-04 Thread Eric Firing
A quick scan of the tickets did not show me anything like the following, but I might have missed it. The attached script generates a segfault on my ubuntu feisty system with svn numpy. Running inside of ipython, the segfault occurs upon exiting ipython, not upon running the script. Running th

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-18 Thread Eric Firing
On 02/17/2012 09:55 PM, David Cournapeau wrote: > I may not have explained it very well: my whole point is that we don't > recruite people, where I understand recruit as hiring full time, > profesional programmers.We need more people who can casually spend a few > hours - typically grad students, s

Re: [Numpy-discussion] change the mask state of one element in a masked array

2012-02-18 Thread Eric Firing
On 02/18/2012 05:52 AM, Chao YUE wrote: > Dear all, > > I built a new empty masked array: > > In [91]: a=np.ma.empty((2,5)) Of course this only makes sense if you are going to immediately populate the array. > > In [92]: a > Out[92]: > masked_array(data = > [[ 1.20569155e-312 3.34730819e-31

Re: [Numpy-discussion] Missing data again

2012-03-07 Thread Eric Firing
On 03/07/2012 09:26 AM, Nathaniel Smith wrote: > On Wed, Mar 7, 2012 at 5:17 PM, Charles R Harris > wrote: >> On Wed, Mar 7, 2012 at 9:35 AM, Pierre Haessig >>> Coming back to Travis proposition "bit-pattern approaches to missing >>> data (*at least* for float64 and int32) need to be implemented.

Re: [Numpy-discussion] Missing data again

2012-03-07 Thread Eric Firing
On 03/07/2012 11:15 AM, Pierre Haessig wrote: > Hi, > Le 07/03/2012 20:57, Eric Firing a écrit : >> In other words, good low-level support for numpy.ma functionality? > Coming back to *existing* ma support, I was just wondering whether it > was now possible to "np.save&

Re: [Numpy-discussion] Using logical function on more than 2 arrays, availability of a "between" function ?

2012-03-25 Thread Eric Firing
On 03/25/2012 06:55 AM, Pierre Haessig wrote: > Hi, > > I have an off topic but somehow related question : > > Le 19/03/2012 12:04, Matthieu Rigal a écrit : >> array = numpy.logical_and(numpy.logical_and(aBlueChannel< 1.0, aNirChannel> >> (aBlueChannel * 1.0)), aNirChannel< (aBlueChannel * 1.8))

Re: [Numpy-discussion] Using logical function on more than 2 arrays, availability of a "between" function ?

2012-03-25 Thread Eric Firing
On 03/25/2012 12:22 PM, Pierre Haessig wrote: > Hi Eric, > > Thanks for the hints ! > > Le 25/03/2012 20:33, Eric Firing a écrit : >> Using the bitwise operators in place of logical operators is a hack to >> get around limitations of the language; but, if done caref

Re: [Numpy-discussion] Masked Arrays in NumPy 1.x

2012-04-10 Thread Eric Firing
On 04/09/2012 06:52 PM, Travis Oliphant wrote: > Hey all, > > I've been waiting for Mark Wiebe to arrive in Austin where he will > spend several weeks, but I also know that masked arrays will be only > one of the things he and I are hoping to make head-way on while he is > in Austin.Nevertheles

Re: [Numpy-discussion] Removing masked arrays for 1.7? (Was 1.7 blockers)

2012-04-17 Thread Eric Firing
On 04/17/2012 08:40 AM, Matthew Brett wrote: > Hi, > > On Tue, Apr 17, 2012 at 7:24 AM, Nathaniel Smith wrote: >> On Tue, Apr 17, 2012 at 5:59 AM, Matthew Brett >> wrote: >>> Hi, >>> >>> On Mon, Apr 16, 2012 at 8:40 PM, Travis Oliphant >>> wrote: Mark and I will have conversations about N

Re: [Numpy-discussion] Fancy-indexing reorders output in corner cases?

2012-05-15 Thread Eric Firing
On 05/14/2012 06:03 PM, Travis Oliphant wrote: > What happens, though when you have > > a[:, in1 :, in2]? > > in1 and in2 are broadcasted together to create a two-dimensional > "sub-space" that must fit somewhere. Where should it go? Should > it replace in1 or in2?I.e. should the output be

Re: [Numpy-discussion] numpy.ma.MaskedArray.min() makes a copy?

2012-09-18 Thread Eric Firing
On 2012/09/18 7:40 AM, Benjamin Root wrote: > > > On Fri, Sep 7, 2012 at 12:05 PM, Nathaniel Smith > wrote: > > On 7 Sep 2012 14:38, "Benjamin Root" > wrote: > > > > An issue just reported on the matplotlib-users list involved a >

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Eric Firing
On 2012/09/18 9:25 AM, Charles R Harris wrote: > > > On Tue, Sep 18, 2012 at 1:13 PM, Benjamin Root > wrote: > > > > On Tue, Sep 18, 2012 at 2:47 PM, Charles R Harris > mailto:charlesr.har...@gmail.com>> wrote: > > > > On Tue, Sep 18, 2012 at 11:39 AM, Benja

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-21 Thread Eric Firing
On 2012/09/21 12:20 PM, Nathaniel Smith wrote: > On Fri, Sep 21, 2012 at 10:04 PM, Chris Barker wrote: >> On Fri, Sep 21, 2012 at 10:03 AM, Nathaniel Smith wrote: >> >>> You're right of course. What I meant is that >>>a += b >>> should produce the same result as >>>a[...] = a + b >>> >>>

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-13 Thread Eric Firing
On 2013/01/13 7:27 AM, Nathaniel Smith wrote: > Hi all, > > PR 2875 adds two new functions, that generalize zeros(), ones(), > zeros_like(), ones_like(), by simply taking an arbitrary fill value: >https://github.com/numpy/numpy/pull/2875 > So >np.ones((10, 10)) > is the same as >np.fill

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-14 Thread Eric Firing
On 2013/01/14 6:15 AM, Olivier Delalleau wrote: > - I agree the name collision with np.ma.filled is a problem. I have no > better suggestion though at this point. How about "initialized()"? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org htt

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-17 Thread Eric Firing
On 2013/01/17 4:13 AM, Pierre Haessig wrote: > Hi, > > Le 14/01/2013 20:05, Benjamin Root a écrit : >> I do like the way you are thinking in terms of the broadcasting >> semantics, but I wonder if that is a bit awkward. What I mean is, if >> one were to use broadcasting semantics for creating an a

Re: [Numpy-discussion] GSOC 2013

2013-03-04 Thread Eric Firing
On 2013/03/04 9:01 PM, Nicolas Rougier wrote: >> >This made me think of a serious performance limitation of structured >> >dtypes: a >> >structured dtype is always "packed", which may lead to terrible byte >> >alignment >> >for common types. For instance, `dtype([('a', 'u1'), ('b', >> >'u8')]).i

Re: [Numpy-discussion] GSOC 2013

2013-03-06 Thread Eric Firing
On 2013/03/05 8:14 AM, Kurt Smith wrote: > On Tue, Mar 5, 2013 at 1:45 AM, Eric Firing wrote: >> On 2013/03/04 9:01 PM, Nicolas Rougier wrote: >>>>> This made me think of a serious performance limitation of structured >>>>> dtypes: a >>>>>

Re: [Numpy-discussion] Python memory management issues using, Linux. Maybe Numpy, related.

2011-05-22 Thread Eric Firing
On 05/22/2011 08:17 AM, Jeffrey Spencer wrote: > from numpy import arange, sum > > for x in range(1000): > inhibVal = sum(arange(15)) Memory usage stays constant with Ubuntu 11.04, 64-bit, using the numpy 1.5.1 package from ubuntu, and using 1.6.1.dev-a265004. efiring@manini:~$ un

Re: [Numpy-discussion] unwrap for masked arrays?

2011-06-17 Thread Eric Firing
On 06/17/2011 06:56 AM, Benjamin Root wrote: > It does not appear that unwrap works properly for masked arrays. First, > it uses np.asarray() at the start of the function. However, that alone > would not fix the problem given the nature of how unwrap works > (performing diff operations). I tried

Re: [Numpy-discussion] fast grayscale conversion

2011-06-20 Thread Eric Firing
On 06/20/2011 10:41 AM, Zachary Pincus wrote: > You could try: > src_mono = src_rgb.astype(float).sum(axis=-1) / 3. > > But that speed does seem slow. Here are the relevant timings on my machine (a > recent MacBook Pro) for a 3.1-megapixel-size array: > In [16]: a = numpy.empty((2048, 1536, 3), dt

Re: [Numpy-discussion] feedback request: proposal to add masks to the core ndarray

2011-06-23 Thread Eric Firing
On 06/23/2011 11:19 AM, Nathaniel Smith wrote: > I'd like to see a statement of what the "missing data problem" is, and > how this solves it? Because I don't think this is entirely intuitive, > or that everyone necessarily has the same idea. > >> Reduction operations like 'sum', 'prod', 'min', and

Re: [Numpy-discussion] Concepts for masked/missing data

2011-06-25 Thread Eric Firing
On 06/25/2011 07:05 AM, Nathaniel Smith wrote: > On Sat, Jun 25, 2011 at 9:26 AM, Matthew Brett > wrote: >> So far I see the difference between 1) and 2) being that you cannot >> unmask. So, if you didn't even know you could unmask data, then it >> would not matter that 1) was being implemented

Re: [Numpy-discussion] Concepts for masked/missing data

2011-06-25 Thread Eric Firing
On 06/25/2011 09:09 AM, Benjamin Root wrote: > > > On Sat, Jun 25, 2011 at 1:57 PM, Nathaniel Smith <mailto:n...@pobox.com>> wrote: > > On Sat, Jun 25, 2011 at 11:50 AM, Eric Firing <mailto:efir...@hawaii.edu>> wrote: > > On 06/25/2011 07:05

Re: [Numpy-discussion] missing data discussion round 2

2011-06-28 Thread Eric Firing
On 06/28/2011 07:26 AM, Nathaniel Smith wrote: > On Tue, Jun 28, 2011 at 9:38 AM, Charles R Harris > wrote: >> Nathaniel, an implementation using masks will look *exactly* like an >> implementation using na-dtypes from the user's point of view. Except that >> taking a masked view of an unmasked a

Re: [Numpy-discussion] missing data discussion round 2

2011-06-29 Thread Eric Firing
On 06/29/2011 09:32 AM, Matthew Brett wrote: > Hi, > [...] > > Clearly there are some overlaps between what masked arrays are trying > to achieve and what Rs NA mechanisms are trying to achieve. Are they > really similar enough that they should function using the same API? > And if so, won't that

Re: [Numpy-discussion] missing data discussion round 2

2011-06-30 Thread Eric Firing
On 06/30/2011 08:53 AM, Nathaniel Smith wrote: > On Wed, Jun 29, 2011 at 2:21 PM, Eric Firing wrote: >> In addition, for new code, the full-blown masked array module may not be >> needed. A convenience it adds, however, is the automatic masking of >> invalid values: >&

Re: [Numpy-discussion] Missing/accumulating data

2011-07-01 Thread Eric Firing
On 07/01/2011 10:27 AM, Charles R Harris wrote: > > > On Fri, Jul 1, 2011 at 1:39 PM, Christopher Barker > mailto:chris.bar...@noaa.gov>> wrote: > > Joe Harrington wrote: > > All > > that has to happen is to allow the sense of the mask to be FALSE > = the > > data are bad, T

Re: [Numpy-discussion] alterNEP - was: missing data discussion round 2

2011-07-01 Thread Eric Firing
On 07/01/2011 06:40 PM, Nathaniel Smith wrote: > On Fri, Jul 1, 2011 at 9:29 AM, Christopher Jordan-Squire > BTW, you can't access the memory of a masked value by taking a view, > at least if I'm reading this version of the NEP correctly, and it > seems to be the latest: > > https://github.com

Re: [Numpy-discussion] using the same vocabulary for missing value ideas

2011-07-06 Thread Eric Firing
On 07/06/2011 07:51 PM, Chris Barker wrote: > On 7/6/11 11:57 AM, Mark Wiebe wrote: >> On Wed, Jul 6, 2011 at 1:25 PM, Christopher Barker > >> Is this really true? if you use a bitpattern for IGNORE, haven't you >> just lost the ability to get the original value back if you want to stop >

Re: [Numpy-discussion] code review request: masked dtype transfers

2011-07-08 Thread Eric Firing
On 07/08/2011 01:31 PM, Mark Wiebe wrote: > I've just made pull request 105: > > https://github.com/numpy/numpy/pull/105 > > This adds public API PyArray_MaskedCopyInto and PyArray_MaskedMoveInto, > which behave analogously to the corresponding unmasked functions. To > expose this with a reasonable

Re: [Numpy-discussion] code review request: masked dtype transfers

2011-07-08 Thread Eric Firing
On 07/08/2011 01:31 PM, Mark Wiebe wrote: > I've just made pull request 105: > > https://github.com/numpy/numpy/pull/105 > > This adds public API PyArray_MaskedCopyInto and PyArray_MaskedMoveInto, > which behave analogously to the corresponding unmasked functions. To > expose this with a reasonable

Re: [Numpy-discussion] code review request: masked dtype transfers

2011-07-09 Thread Eric Firing
On 07/08/2011 01:31 PM, Mark Wiebe wrote: > I've just made pull request 105: > > https://github.com/numpy/numpy/pull/105 > It's merged, which is good, but I have a suggestion relevant to that pull and I suspect to many others to come: use defines and macros to consolidate some of the implementat

Re: [Numpy-discussion] numpy.interp running time

2011-07-30 Thread Eric Firing
On 07/29/2011 11:18 AM, Timo Kluck wrote: > Dear numpy developers, > > The current implementation of numpy.interp(x,xp,fp) comes down to: first > calculating all the slopes of the linear interpolant (these are > len(xp)-1), then use a binary search to find where x is in xp (running > time log(len(x

Re: [Numpy-discussion] Reading a big netcdf file

2011-08-03 Thread Eric Firing
On 08/03/2011 11:24 AM, Gökhan Sever wrote: > I[1]: timeit a = np.fromfile('temp.npa', dtype=np.uint16) > 1 loops, best of 3: 263 ms per loop You need to clear your cache and then run timeit with options "-n1 -r1". Eric ___ NumPy-Discussion mailing lis

Re: [Numpy-discussion] numpy.interp running time

2011-08-16 Thread Eric Firing
On 08/16/2011 04:22 AM, Timo Kluck wrote: > 2011/8/1 Timo Kluck: >> I just submitted a patch at >> http://projects.scipy.org/numpy/ticket/1920 . It implements Eric's >> suggestion. Please review, I'll be happy to adapt it to any of your >> feedback. >> > I submitted a minor patch a while ago. It ha

Re: [Numpy-discussion] wanted: decent matplotlib alternative

2011-10-13 Thread Eric Firing
On 10/13/2011 12:22 PM, Gökhan Sever wrote: > > > On Thu, Oct 13, 2011 at 4:15 PM, Benjamin Root > wrote: > > Myself and other developers would greatly appreciate help from the > community to point out which examples are too confusing or out of > date. We > > >

Re: [Numpy-discussion] anyway to check a ndarray is a mased array or not?

2011-10-18 Thread Eric Firing
On 10/18/2011 03:13 AM, Olivier Delalleau wrote: > if hasattr(a, 'mask'): # or if isinstance(a, numpy.ma.core.MaskedArray.) or if numpy.ma.isMA(a): or if numpy.ma.isMaskedArray(a): Eric > code 1 > else > code 2 > > -=- Olivier > > 2011/10/18 Chao YUE mailto:chaoyue...@gmail.com>>

Re: [Numpy-discussion] NA masks in the next numpy release?

2011-10-23 Thread Eric Firing
On 10/23/2011 10:49 AM, Nathaniel Smith wrote: > But I (and presumably others) were unaware of the pull request, > because it turns out that actually Mark did*not* point to the pull > request, at least in email to either me or numpy-discussion. As far as > I can tell, the first time that pull requ

Re: [Numpy-discussion] NA masks in the next numpy release?

2011-10-23 Thread Eric Firing
On 10/23/2011 12:34 PM, Nathaniel Smith wrote: > like. And in this case I do think we can come up with an API that will > make everyone happy, but that Mark's current API probably can't be > incrementally evolved to become that API.) > No one could object to coming up with an API that makes every

Re: [Numpy-discussion] NA masks in the next numpy release?

2011-10-25 Thread Eric Firing
On 10/25/2011 04:56 PM, Travis Oliphant wrote: > So, I am very interested in making sure I remember the details of the > counterproposal.What I recall is that you wanted to be able to > differentiate between a "bit-pattern" mask and a boolean-array mask > in the API. I believe currently even

Re: [Numpy-discussion] consensus (was: NA masks in the next numpy release?)

2011-10-29 Thread Eric Firing
On 10/29/2011 12:26 AM, Ralf Gommers wrote: > The history of this discussion doesn't suggest it straightforward to get > a design right first time. It's a complex subject. > > The second part of your statement, "and then implement", sounds so > simple. The reality is that there are only a handful o

Re: [Numpy-discussion] consensus (was: NA masks in the next numpy release?)

2011-10-29 Thread Eric Firing
On 10/29/2011 12:02 PM, Olivier Delalleau wrote: > > I haven't been following the discussion closely, but wouldn't it be instead: > a.mask[0:2] = True? That would be consistent with numpy.ma and the opposite of Mark's implementation. I can live with either, but I much prefer the numpy.ma versio

Re: [Numpy-discussion] consensus (was: NA masks in the next numpy release?)

2011-10-29 Thread Eric Firing
On 10/29/2011 12:57 PM, Charles R Harris wrote: > > > On Sat, Oct 29, 2011 at 4:47 PM, Eric Firing <mailto:efir...@hawaii.edu>> wrote: > > On 10/29/2011 12:02 PM, Olivier Delalleau wrote: > > > > > I haven't been following the discussi

Re: [Numpy-discussion] NetCDF4/numpy question

2012-01-27 Thread Eric Firing
On 01/27/2012 11:18 AM, Howard wrote: > Hi all > > I am a fairly recent convert to python and I have got a question that's > got me stumped. I hope this is the right mailing list: here goes :) > > I am reading some time series data out of a netcdf file a single > timestep at a time. If the data is

Re: [Numpy-discussion] numpy.arange() error?

2012-02-08 Thread Eric Firing
On 02/08/2012 09:31 PM, teomat wrote: > > Hi, > > Am I wrong or the numpy.arange() function is not correct 100%? > > Try to do this: > > In [7]: len(np.arange(3.1, 4.9, 0.1)) > Out[7]: 18 > > In [8]: len(np.arange(8.1, 9.9, 0.1)) > Out[8]: 19 > > I would expect the same result for each command. No

Re: [Numpy-discussion] numpy.arange() error?

2012-02-09 Thread Eric Firing
On 02/09/2012 09:20 AM, Drew Frank wrote: > Eric Firing hawaii.edu> writes: > >> >> On 02/08/2012 09:31 PM, teomat wrote: >>> >>> Hi, >>> >>> Am I wrong or the numpy.arange() function is not correct 100%? >>> >>> T

Re: [Numpy-discussion] Migrating issues to GitHub

2012-02-11 Thread Eric Firing
On 02/11/2012 10:44 AM, Travis Oliphant wrote: > This is good feedback. > > It looks like there are 2 concerns: > > 1) no way to add attachments --- it would seem that gists and indeed > other github repos solves that problem. Not really, in practice. Yes one can use these mechanisms, but they ar

Re: [Numpy-discussion] Change in scalar upcasting rules for 1.6.x?

2012-02-14 Thread Eric Firing
On 02/13/2012 08:07 PM, Charles R Harris wrote: > > > Let it go, Travis. It's a waste of time. (Off-list) Chuck, I really appreciate your consistent good sense; this is just one of many examples. Thank you for all your numpy work. Eric ___ NumPy-Disc

Re: [Numpy-discussion] Numpy governance update

2012-02-15 Thread Eric Firing
On 02/15/2012 08:50 AM, Matthew Brett wrote: > Hi, > > On Wed, Feb 15, 2012 at 5:51 AM, Alan G Isaac wrote: >> On 2/14/2012 10:07 PM, Bruce Southey wrote: >>> The one thing that gets over looked here is that there is a huge >>> diversity of users with very different skill levels. But very few >>>

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-17 Thread Eric Firing
On 02/17/2012 05:39 AM, Charles R Harris wrote: > > > On Fri, Feb 17, 2012 at 8:01 AM, David Cournapeau > wrote: > > Hi Travis, > > On Thu, Feb 16, 2012 at 10:39 PM, Travis Oliphant > mailto:tra...@continuum.io>> wrote: > > Mark Wiebe and I have been dis

Re: [Numpy-discussion] suggested change of behavior for interp

2013-06-04 Thread Eric Firing
On 2013/06/04 2:05 PM, Charles R Harris wrote: > > > On Tue, Jun 4, 2013 at 12:07 PM, Slavin, Jonathan > mailto:jsla...@cfa.harvard.edu>> wrote: > > Hi, > > I would like to suggest that the behavior of numpy.interp be changed > regarding treatment of situations in which the x-coordinate

Re: [Numpy-discussion] suggested change of behavior for interp

2013-06-04 Thread Eric Firing
case that I think might reasonably be an option but that should not be required. Eric > > I have been bitten by this problem too. > > Cheers! > Ben Root > > On Jun 4, 2013 9:08 PM, "Eric Firing" <mailto:efir...@hawaii.edu>> wrote: >

Re: [Numpy-discussion] empty_like for masked arrays

2013-06-10 Thread Eric Firing
On 2013/06/10 10:17 AM, Aldcroft, Thomas wrote: > I use np.ma , and for me the most intuitive would be the > second option where the new array matches the original array in shape > and dtype, but always has an empty mask. I always think of the *_like() > functions as just copying sha

Re: [Numpy-discussion] numpy.filled, again

2013-06-12 Thread Eric Firing
On 2013/06/12 2:10 AM, Nathaniel Smith wrote: > Hi all, > > It looks like we've gotten a bit confused and need to untangle > something. There's a PR to add new functions 'np.filled' and > 'np.filled_like': >https://github.com/numpy/numpy/pull/2875 > And there was a discussion about this on the

Re: [Numpy-discussion] numpy.filled, again

2013-06-12 Thread Eric Firing
On 2013/06/12 4:18 AM, Nathaniel Smith wrote: > Now imagine a different new version of this page, if we overload > 'empty' to add a fill= option. I don't even know how we document that > on this page. The list will remain: >empty >ones >zeros Opposite of "empty": "full". So that is an

Re: [Numpy-discussion] numpy.filled, again

2013-06-12 Thread Eric Firing
On 2013/06/12 8:13 AM, Warren Weckesser wrote: > That's why I suggested 'filledwith' (add the underscore if you like). > This also allows a corresponding masked implementation, 'ma.filledwith', > without clobbering the existing 'ma.filled'. Consensus on np.filled? absolutely not, you do not have a

Re: [Numpy-discussion] numpy.filled, again

2013-06-13 Thread Eric Firing
On 2013/06/13 10:36 AM, Benjamin Root wrote: > > On Thu, Jun 13, 2013 at 9:36 AM, Aldcroft, Thomas > mailto:aldcr...@head.cfa.harvard.edu>> > wrote: > > > > > On Wed, Jun 12, 2013 at 2:55 PM, Eric Firing <mailto:efir...@hawaii.edu>> wrote:

Re: [Numpy-discussion] numpy.filled, again

2013-06-14 Thread Eric Firing
On 2013/06/14 5:15 AM, Alan G Isaac wrote: > On 6/14/2013 9:27 AM, Aldcroft, Thomas wrote: >> If I just saw np.values(..) in some code I would never guess what it is >> doing from the name > > That suggests np.fromvalues. > But more important than the name I think > is allowing broadcasting of the

[Numpy-discussion] NA, and replacement or reimplimentation of np.ma

2013-06-14 Thread Eric Firing
On 2013/06/14 7:22 AM, Nathaniel Smith wrote: > On Wed, Jun 12, 2013 at 7:43 PM, Eric Firing wrote: >> On 2013/06/12 2:10 AM, Nathaniel Smith wrote: >>> Personally I think that overloading np.empty is horribly ugly, will >>> continue confusing newbies and everyone

[Numpy-discussion] time to revisit NA/ma ideas

2013-06-14 Thread Eric Firing
A nice summary of the discussions from a year ago is here: http://www.numpy.org/NA-overview.html It provides food for thought. Eric ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] saving 3d array

2013-06-15 Thread Eric Firing
On 2013/06/15 6:06 AM, Pierre GM wrote: > > On Jun 15, 2013, at 17:35 , Matthew Brett wrote: > >> Hi, >> >> On Sat, Jun 15, 2013 at 2:51 PM, Sudheer Joseph >> wrote: >>> >>> Thank you very much for this tip. >>> Is there a typical way to save masked and the rest separately?. Not much >>> familia

[Numpy-discussion] bug fixes: which branch?

2013-06-16 Thread Eric Firing
What is the preferred strategy for handling bug fix PRs? Initial fix on master, and then a separate PR to backport to v1.7.x? Or the reverse? It doesn't look like v1.7.x is being merged into master regularly, so the matplotlib pattern (fix on maintenance, merge maintenance into master) seems

[Numpy-discussion] please close 611, 629, 2490, 2264

2013-06-16 Thread Eric Firing
Github issues 611, 629, and 2490 are duplicates. 611 included patches with a test and a fix, both of which were committed long ago, so all three issues should be closed. Please see my comment on 2264 as to why that should be closed. On 1417, please remove the "component:numpy.ma" label and add

Re: [Numpy-discussion] strange behavior of variable

2013-08-18 Thread Eric Firing
On 2013/08/17 9:49 PM, Sudheer Joseph wrote: > Hi, > I have defined a small function to find the n maximum values > of an array as below. With in it I assign the input array to a second > array and temporarily make the array location after first iteration as > nan. I expected this tempora

Re: [Numpy-discussion] Strange behavior with boolean slices...

2013-08-25 Thread Eric Firing
On 2013/08/25 2:30 PM, Cera, Tim wrote: > I have done this before, but am now really confused. > > Created an array 'day' specifying the 'f' type > > In [29]: day > Out[29]: array([ 5., 5.], dtype=float32) > > # Have a mask... > In [30]: mask > Out[30]: array([ True, False], dtype=bool) > > # So f

Re: [Numpy-discussion] Strange behavior with boolean slices...

2013-08-25 Thread Eric Firing
On 2013/08/25 2:30 PM, Cera, Tim wrote: > I have done this before, but am now really confused. > > Created an array 'day' specifying the 'f' type > > In [29]: day > Out[29]: array([ 5., 5.], dtype=float32) > > # Have a mask... > In [30]: mask > Out[30]: array([ True, False], dtype=bool) > > # So f

Re: [Numpy-discussion] Masked arrays: Rationale for "False convention"

2013-09-30 Thread Eric Firing
On 2013/09/30 4:05 PM, josef.p...@gmail.com wrote: > On Mon, Sep 30, 2013 at 9:38 PM, Charles R Harris > wrote: >> >> >> >> On Mon, Sep 30, 2013 at 7:05 PM, Ondřej Čertík >> wrote: >>> >>> Hi, >>> >>> What is the rationale for using False in 'mask' for elements that >>> should be included? >>> >>

Re: [Numpy-discussion] Masked arrays: Rationale for "False convention"

2013-09-30 Thread Eric Firing
On 2013/09/30 4:57 PM, Ondřej Čertík wrote: > On Mon, Sep 30, 2013 at 8:29 PM, Eric Firing wrote: >> On 2013/09/30 4:05 PM, josef.p...@gmail.com wrote: >>> On Mon, Sep 30, 2013 at 9:38 PM, Charles R Harris >>> wrote: >>>> >>>> >>>>

Re: [Numpy-discussion] surprising behavior of np.asarray on masked arrays

2013-12-05 Thread Eric Firing
On 2013/12/05 5:14 PM, Faraz Mirzaei wrote: > Hi, > > If I pass a masked array through np.asarray, I get original unmasked array. > > Example: > > test = np.array([[1, 0], [-1, 3]]) > > testMasked = ma.masked_less_equal(test, 0) > > > print testMasked > > [[1 --] > > [-- 3]] > > > print testMaske

  1   2   3   >