Re: [Numpy-discussion] Meta: help, devel and stackoverflow

2012-06-30 Thread John Hunter
On Fri, Jun 29, 2012 at 2:20 PM, Jim Vickroy wrote: > As a lurker and user, I too wish for a distinct numpy-users list. -- jv > > This thread is a perfect example of why another list is needed. It's currently 42 semi-philosophical posts about what kind community numpy should be and what kinds o

Re: [Numpy-discussion] Dropping support for Python 2.4 in NumPy 1.8

2012-06-28 Thread John Hunter
On Thu, Jun 28, 2012 at 7:25 AM, Travis Oliphant wrote: > Hey all, > > I'd like to propose dropping support for Python 2.4 in NumPy 1.8 (not the 1.7 > release).      What does everyone think of that? As a tangential point, MPL is dropping support for python2.4 in it's next major release. As su

Re: [Numpy-discussion] NumPy 1.7 release delays

2012-06-27 Thread John Hunter
> Some examples would be nice. A lot of people did move already. And I haven't > seen reports of those that tried and got stuck. Also, Debian and Python(x, > y) have 1.6.2, EPD has 1.6.1. In my company, the numpy for our production python install is well behind 1.6. In the world of trading, the u

Re: [Numpy-discussion] Created NumPy 1.7.x branch

2012-06-26 Thread John Hunter
On Tue, Jun 26, 2012 at 3:27 PM, Thouis (Ray) Jones wrote: > +1 ! > > Speaking as someone trying to get started in contributing to numpy, I > find this discussion extremely off-putting.  It's childish, > meaningless, and spiteful, and I think it's doing more harm than any > possible good that coul

Re: [Numpy-discussion] all elements equal

2012-03-05 Thread John Hunter
On Mon, Mar 5, 2012 at 1:29 PM, Keith Goodman wrote: > > I[8] np.allclose(a, a[0]) > O[8] False > I[9] a = np.ones(10) > I[10] np.allclose(a, a[0]) > O[10] True > > One disadvantage of using a[0] as a proxy is that the result depends on the ordering of a (a.max() - a.min()) < epsilon is a

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-29 Thread John Hunter
On Wed, Feb 29, 2012 at 1:20 PM, Neal Becker wrote: > > Much of Linus's complaints have to do with the use of c++ in the _kernel_. > These objections are quite different for an _application_. For example, > there > are issues with the need for support libraries for exception handling. > Not an

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-28 Thread John Hunter
On Sat, Feb 18, 2012 at 5:09 PM, David Cournapeau wrote: > > There are better languages than C++ that has most of the technical > benefits stated in this discussion (rust and D being the most > "obvious" ones), but whose usage is unrealistic today for various > reasons: knowledge, availability on

Re: [Numpy-discussion] Numpy governance update

2012-02-16 Thread John Hunter
On Thu, Feb 16, 2012 at 7:26 PM, Alan G Isaac wrote: > On 2/16/2012 7:22 PM, Matthew Brett wrote: > > This has not been an encouraging episode in striving for consensus. > > I disagree. > Failure to reach consensus does not imply lack of striving. > > Hey Alan, thanks for your thoughtful and nuan

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

2011-10-13 Thread John Hunter
On Thu, Oct 13, 2011 at 5:36 PM, Eric Firing wrote: >> It would be nice to have a social interface for the mpl gallery like the >> one similar to the R-gallery >> [http://www.r-bloggers.com/the-r-graph-gallery-goes-social/] > > I think that the priority should go towards massive pruning, > organi

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

2011-10-13 Thread John Hunter
On Oct 13, 2011, at 4:21 PM, Zachary Pincus wrote: > I keep meaning to use matplotlib as well, but every time I try I also get > really turned off by the matlabish interface in the examples. I get that it's > a selling point for matlab refugees, but I find it counterintuitive in the > same

Re: [Numpy-discussion] segfault on complex array on solaris x86

2011-08-17 Thread John Hunter
On Wed, Apr 13, 2011 at 8:50 AM, John Hunter wrote: > On Sat, Jan 15, 2011 at 7:28 AM, Ralf Gommers > wrote: >> I've opened http://projects.scipy.org/numpy/ticket/1713 so this doesn't get >> lost. > > Just wanted to bump this -- bug still exists in numpy HEAD

Re: [Numpy-discussion] segfault on complex array on solaris x86

2011-04-13 Thread John Hunter
On Sat, Jan 15, 2011 at 7:28 AM, Ralf Gommers wrote: > I've opened http://projects.scipy.org/numpy/ticket/1713 so this doesn't get > lost. Just wanted to bump this -- bug still exists in numpy HEAD 2.0.0.dev-fe3852f ___ NumPy-Discussion mailing list Num

[Numpy-discussion] segfault on complex array on solaris x86

2011-01-05 Thread John Hunter
jo...@udesktop253:~> gcc --version gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath) Copyright (C) 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. jo...@udeskt

Re: [Numpy-discussion] recarray to csv

2010-09-03 Thread John Hunter
On Fri, Sep 3, 2010 at 8:50 AM, Benjamin Root wrote: > Why is this function in matplotlib?  Wouldn't it be more useful in numpy? I tend to add stuff I write to matplotlib. mlab was initially a repository of matlab-like functions that were not available in numpy (load, save, linspace, psd, coher

Re: [Numpy-discussion] recarray to csv

2010-09-03 Thread John Hunter
2010/9/3 Guillaume Chérel : >  Great, Thank you. I also found out about csv2rec. I've been missing > these two a lot. Some other handy rec functions in mlab http://matplotlib.sourceforge.net/examples/misc/rec_groupby_demo.html http://matplotlib.sourceforge.net/examples/misc/rec_join_demo.html JD

Re: [Numpy-discussion] save data to csv with column names

2010-08-16 Thread John Hunter
2010/8/16 Guillaume Chérel : > Hello, > I'd like to know if there is an easy way to save a list of 1D arrays to a > csv file, with the first line of the file being the column names. > > I found the following, but I can't get to save the column names: > > data = rec.array([X1,X2,X3,X4], names=[n1,n

Re: [Numpy-discussion] [SciPy-Dev] Good-bye, sort of (John Hunter)

2010-08-13 Thread John Hunter
On Fri, Aug 13, 2010 at 3:41 PM, Benjamin Root wrote: > @Josh: Awesome name.  Very fitting... > > Another thing that I really love about matplotlib that drove me nuts in > Matlab was being unable to use multiple colormaps in the same figure. Funny -- this was one of the *first* things I thought a

Re: [Numpy-discussion] [SciPy-Dev] Good-bye, sort of

2010-08-13 Thread John Hunter
On Fri, Aug 13, 2010 at 11:47 AM, David Goldsmith wrote: > 2010/7/30 Stéfan van der Walt >> >> Hi David >> >> Best of luck with your new position! I hope they don't make you program >> too much MATLAB! > > After several years now of writing Python and now having written my first > on-the-job 15 o

Re: [Numpy-discussion] isinf raises in inf

2010-07-15 Thread John Hunter
On Thu, Jul 15, 2010 at 7:27 PM, Charles R Harris wrote: > > > On Thu, Jul 15, 2010 at 6:11 PM, John Hunter wrote: >> >> On Thu, Jul 15, 2010 at 6:14 PM, Eric Firing wrote: >> > Is it certain that the Solaris compiler lacks isinf?  Is it possible >> &

Re: [Numpy-discussion] isinf raises in inf

2010-07-15 Thread John Hunter
On Thu, Jul 15, 2010 at 7:11 PM, John Hunter wrote: > On Thu, Jul 15, 2010 at 6:14 PM, Eric Firing wrote: >> Is it certain that the Solaris compiler lacks isinf?  Is it possible >> that it has it, but it is not being detected? > > Just to clarify, I'm not using the sun

Re: [Numpy-discussion] isinf raises in inf

2010-07-15 Thread John Hunter
On Thu, Jul 15, 2010 at 6:14 PM, Eric Firing wrote: > Is it certain that the Solaris compiler lacks isinf?  Is it possible > that it has it, but it is not being detected? Just to clarify, I'm not using the sun compiler, but gcc-3.4.3 on solaris x86 ___

[Numpy-discussion] isinf raises in inf

2010-07-15 Thread John Hunter
I am seeing a problem on Solaris since I upgraded to svn HEAD. np.isinf does not handle np.inf. See ipython session below. I am not seeing this problem w/ HEAD on an ubuntu linux box I tested on In [1]: import numpy as np In [2]: np.__version__ Out[2]: '2.0.0.dev8480' In [3]: x = np.inf np.inf

[Numpy-discussion] cannot set dtype on record array with 04 datetime records

2010-07-14 Thread John Hunter
I use record arrays extensively with python datetimes, which works if you pass in a list of lists of data with the names. numpy can accurately infer the dtypes and create a usable record array. Eg, import datetime import numpy as np rows = [ [datetime.date(2001,1,1), 12, 23.],

Re: [Numpy-discussion] numpy, matplotlib and masked arrays

2010-07-09 Thread John Hunter
On Fri, Jul 9, 2010 at 8:03 PM, Peter Isaac wrote: > Note that EPD-6.2-2 works fine with this script on WinXP. > Any suggestions welcome then just use epd-6.2.2 on winxp. your-mpl-developer-channeling-steve-jobs, JDH ___ NumPy-Discussion mailing lis

Re: [Numpy-discussion] Is there really a moderator that reviews posts?

2010-06-08 Thread John Hunter
On Tue, Jun 8, 2010 at 10:33 AM, Sebastian Haase wrote: > On Tue, Jun 8, 2010 at 5:23 PM, David Goldsmith > wrote: >> On Tue, Jun 8, 2010 at 12:10 AM, Sebastian Haase >> wrote: >>> >>> I don't want to complain >>> But what is wrong with a limit of 40kB ? There are enough places where >>> o

Re: [Numpy-discussion] PSF GSoC 2010 (Py3K focus)

2010-03-09 Thread John Hunter
On Mon, Mar 8, 2010 at 11:39 PM, Charles R Harris wrote: >> - port matplotlib to Py3K We'd be happy to mentor a project here. To my knowledge, nothing has been done, other than upgrade to CXX6 (our C++ extension lib). Most, but not all, of our extension code is exposed through CXX, which as of

Re: [Numpy-discussion] Emulate left outer join?

2010-02-10 Thread John Hunter
On Wed, Feb 10, 2010 at 8:54 AM, John Hunter wrote: > On Tue, Feb 9, 2010 at 7:53 PM, Pierre GM wrote: >> On Feb 9, 2010, at 8:16 PM, John Hunter wrote: > >>> and have "totxt", "tocsv". etc... from rec2txt, rec2csv, etc...   I >>> think the func

Re: [Numpy-discussion] Emulate left outer join?

2010-02-10 Thread John Hunter
On Tue, Feb 9, 2010 at 7:53 PM, Pierre GM wrote: > On Feb 9, 2010, at 8:16 PM, John Hunter wrote: >> and have "totxt", "tocsv". etc... from rec2txt, rec2csv, etc...   I >> think the functionality of mlab.rec_summarize and rec_groupby is very >> useful, bu

Re: [Numpy-discussion] Emulate left outer join?

2010-02-09 Thread John Hunter
On Tue, Feb 9, 2010 at 7:02 PM, Pierre GM wrote: > On Feb 9, 2010, at 7:54 PM, Pauli Virtanen wrote: >> >> But, should we make these functions available under some less >> internal-ish namespace? There's numpy.rec at the least -- it could be >> made a real module to pull in things from core and li

Re: [Numpy-discussion] Emulate left outer join?

2010-02-09 Thread John Hunter
On Tue, Feb 9, 2010 at 4:43 PM, Fernando Perez wrote: > On Tue, Feb 9, 2010 at 5:02 PM, Robert Kern wrote: >> >> numpy.lib.recfunctions.join_by(key, r1, r2, jointype='leftouter') >> > > And if that isn't sufficient, John has in matplotlib.mlab a few other > similar utilities that allow for more c

[Numpy-discussion] ANN: job opening at Tradelink

2009-12-14 Thread John Hunter
We are looking to hire a quantitative researcher to help research and develop trading ideas, and to develop and support infrastructure to put these trading strategies into production. We are looking for someone who is bright and curious with a quantitative background and a strong interest in writi

Re: [Numpy-discussion] Bug in rec.fromarrays ; plus one other possible bug

2009-11-25 Thread John Hunter
On Wed, Nov 25, 2009 at 8:48 AM, Dan Yamins wrote: > Am I just not supposed to be working with length-0 string columns, period? But why would you want to? array dtypes are immutable, so you are saying: I want this field to be only empty strings now and forever. So you can't initialize them to b

Re: [Numpy-discussion] matplotlib is breaking numpy

2009-11-19 Thread John Hunter
toolbar? It keeps a ref to the canvas. If you can create a small freestanding example, that would help -Mathew On Thu, Nov 19, 2009 at 10:42 AM, John Hunter wrote: On Nov 19, 2009, at 12:35 PM, Mathew Yeates wrote: Yeah, I tried that. Here's what I'm doing. I have an a

Re: [Numpy-discussion] matplotlib is breaking numpy

2009-11-19 Thread John Hunter
ular references. Pyplot close does this automatically, but this does not apply to embedding. How are you running you app? From the shell or IPython? Mathew On Thu, Nov 19, 2009 at 10:30 AM, John Hunter wrote: On Nov 19, 2009, at 11:57 AM, Robert Kern wrote: > On Thu, Nov

Re: [Numpy-discussion] matplotlib is breaking numpy

2009-11-19 Thread John Hunter
On Nov 19, 2009, at 11:57 AM, Robert Kern wrote: > On Thu, Nov 19, 2009 at 11:52, Mathew Yeates > wrote: >> There is definitely something wrong with matplotlib/numpy. Consider >> the >> following >>> from numpy import * >>> mydata=memmap('map.dat',dtype=float64,mode='w+',shape=56566500)

[Numpy-discussion] masked index surprise

2009-08-14 Thread John Hunter
I just tracked down a subtle bug in my code, which is equivalent to In [64]: x, y = np.random.rand(2, n) In [65]: z = np.zeros_like(x) In [66]: mask = x>0.5 In [67]: z[mask] = x/y I meant to write z[mask] = x[mask]/y[mask] so I can fix my code, but why is line 67 allowed In [68]: z[m

Re: [Numpy-discussion] adaptive sampling of an interval or plane

2009-08-13 Thread John Hunter
On Wed, Aug 12, 2009 at 6:28 AM, John Hunter wrote: > We would like to add function plotting to mpl, but to do this right we > need to be able to adaptively sample a function evaluated over an > interval so that some tolerance condition is satisfied, perhaps with > both a relative

[Numpy-discussion] adaptive sampling of an interval or plane

2009-08-12 Thread John Hunter
We would like to add function plotting to mpl, but to do this right we need to be able to adaptively sample a function evaluated over an interval so that some tolerance condition is satisfied, perhaps with both a relative and absolute error tolerance condition. I am a bit out of my area of compete

[Numpy-discussion] yubnub and numpy examples

2009-08-05 Thread John Hunter
yubnub is pretty cool -- it's a command line interface for the web. You can enable it in firefox by typing "about:config" in the URL bar, scrolling down to "keyword.URL", right click on the line and choose modify, and set the value to be http://www.yubnub.org/parser/parse?default=g2&command= Then

Re: [Numpy-discussion] binary builds against older numpys

2009-05-20 Thread John Hunter
2009/5/20 Stéfan van der Walt : > David Cournapeau also put a check in place so that the NumPy build > will break if we forget to update the API version again. > > So, while we can't change the releases of NumPy out there already, we > can at least ensure that this won't happen again. OK, great -

[Numpy-discussion] binary builds against older numpys

2009-05-20 Thread John Hunter
We are trying to build and test mpl installers for python2.4, 2.5 and 2.6. What we are finding is that if we build mpl against a more recent numpy than the installed numpy on a test machine, the import of mpl extension modules which depend on numpy trigger a segfault. Eg, on python2.5 and python2

[Numpy-discussion] numpy save files from C

2009-02-26 Thread John Hunter
A colleague of mine has a bunch of numpy arrays saved with np.save and he now wants to access them directly in C, with or w/o the numpy C API doesn't matter. Does anyone have any sample code lying around which he can borrow from? The array is a structured array with an otherwise plain vanilla dty

Re: [Numpy-discussion] Singular Matrix problem with Matplitlib in Numpy (Windows - AMD64)

2009-01-16 Thread John Hunter
Andrew, since you are the original author of the isnan port, could you patch the branch and the trunk to take care of this? JDH On Fri, Jan 16, 2009 at 8:07 AM, George wrote: > Hello. > > I am terribly sorry. I was mistaken last night. I had the latest Matplotlib > version 0.98.5.2 and I thought

Re: [Numpy-discussion] my cython is slow

2009-01-08 Thread John Hunter
On Thu, Jan 8, 2009 at 12:34 PM, Eric Firing wrote: > John Hunter wrote: >> On Wed, Jan 7, 2009 at 5:37 PM, Eric Firing wrote: >> >>> A couple small changes speed it up quite a bit: >>> >>> efir...@manini:~/temp/nnbf$ python test_nnbf.py >>>

Re: [Numpy-discussion] my cython is slow

2009-01-08 Thread John Hunter
On Wed, Jan 7, 2009 at 5:37 PM, Eric Firing wrote: > A couple small changes speed it up quite a bit: > > efir...@manini:~/temp/nnbf$ python test_nnbf.py > loading data... this could take a while > testing nnbf... >10 trials: mean=0.0150, min=0.0100 > testing numpy... >10 trials: mean=0.

[Numpy-discussion] my cython is slow

2009-01-07 Thread John Hunter
Partly as an excuse to learn cython, and partly because I need to eke out some extra performance of a neighborhood search, I tried to code up a brute force neighborhood search in cython around an N-dimensional point p. I need to incrementally add a point, do a search, add another point, do another

Re: [Numpy-discussion] [Newbie] Fast plotting

2009-01-07 Thread John Hunter
On Wed, Jan 7, 2009 at 6:37 AM, Franck Pommereau wrote: > def f4 (x, y) : >"""Jean-Baptiste Rudant > >test 1 CPU times: 111.21s >test 2 CPU times: 13.48s > >As Jean-Baptiste noticed, this solution is not very efficient (but >works almost of-the-shelf). >""" >recXY = n

Re: [Numpy-discussion] Re : [Newbie] Fast plotting

2009-01-06 Thread John Hunter
On Tue, Jan 6, 2009 at 7:38 AM, Jean-Baptiste Rudant wrote: > Hello, > I'm not an expert. Something exists in matplotlib, but it's not very > efficient. > import matplotlib.mlab > import numpy > N = 1000 > X = numpy.random.randint(0, 10, N) > Y = numpy.random.random(N) > recXY = numpy.rec.fromarr

Re: [Numpy-discussion] missing doc dir in the official tarball

2008-12-21 Thread John Hunter
On Fri, Dec 19, 2008 at 4:30 PM, Ondrej Certik wrote: > while packaging the new version of numpy, I realized that it is > missing a documentation. I just checked with Stefan on Jabber and he > thinks > it should be rather a trivial fix. Do you Jarrod think you could > please release a new tarball

Re: [Numpy-discussion] new incremental statistics project

2008-12-19 Thread John Hunter
On Fri, Dec 19, 2008 at 12:59 PM, Eric Firing wrote: > Licensing is no problem; I have never bothered with it, but I can tack on a > BSD-type license if that would help. Great -- if you are the copyright holder, would you commit a BSD license file to the py4science trailstats dir? I just commit

Re: [Numpy-discussion] new incremental statistics project

2008-12-19 Thread John Hunter
On Thu, Dec 18, 2008 at 8:27 PM, Bradford Cross wrote: > This is a new project I just released. > > I know it is C#, but some of the design and idioms would be nice in > numpy/scipy for working with discrete event simulators, time series, and > event stream processing. > > http://code.google.com/p

Re: [Numpy-discussion] Fwd: np.loadtxt : yet a new implementation...

2008-12-01 Thread John Hunter
On Mon, Dec 1, 2008 at 1:14 PM, Pierre GM <[EMAIL PROTECTED]> wrote: >> The problem you have is that the default dtype is 'float' (for >> backwards compatibility w/ the original np.loadtxt). What you want >> is to automatically change the dtype according to the content of >> your file: you should

Re: [Numpy-discussion] np.loadtxt : yet a new implementation...

2008-12-01 Thread John Hunter
On Mon, Dec 1, 2008 at 12:21 PM, Pierre GM <[EMAIL PROTECTED]> wrote: > Well, looks like the attachment is too big, so here's the implementation. > The tests will come in another message.\ It looks like I am doing something wrong -- trying to parse a CSV file with dates formatted like '2008-10-14

Re: [Numpy-discussion] More loadtxt() changes

2008-11-26 Thread John Hunter
On Tue, Nov 25, 2008 at 11:23 PM, Ryan May <[EMAIL PROTECTED]> wrote: > Updated patch attached. This includes: > * Updated docstring > * New tests > * Fixes for previous issues > * Fixes to make new tests actually work > > I appreciate any and all feedback. I'm having trouble applying your p

Re: [Numpy-discussion] More loadtxt() changes

2008-11-25 Thread John Hunter
On Tue, Nov 25, 2008 at 2:01 PM, Pierre GM <[EMAIL PROTECTED]> wrote: > > On Nov 25, 2008, at 2:26 PM, John Hunter wrote: >> >> Yes, I've said on a number of occasions I'd like to see these >> functions in numpy, since a number of them make more sense

Re: [Numpy-discussion] More loadtxt() changes

2008-11-25 Thread John Hunter
On Tue, Nov 25, 2008 at 12:16 PM, Pierre GM <[EMAIL PROTECTED]> wrote: > A la mlab.csv2rec ? It could work with a bit more tweaking, basically > following John Hunter's et al. path. What happens when the column names are > unknown (read from the header) or wrong ? > > Actually, I'd like John to co

[Numpy-discussion] contiguous regions

2008-11-20 Thread John Hunter
I frequently want to break a 1D array into regions above and below some threshold, identifying all such subslices where the contiguous elements are above the threshold. I have two related implementations below to illustrate what I am after. The first "crossings" is rather naive in that it doesn't

Re: [Numpy-discussion] how to tell if a point is inside a polygon

2008-10-17 Thread John Hunter
On Thu, Oct 16, 2008 at 2:28 PM, Rob Hetland <[EMAIL PROTECTED]> wrote: > I did not know that very useful thing. But now I do. This is solid > proof that lurking on the mailing lists makes you smarter. and that our documentation effort still has a long way to go ! FAQ added at http://matplotli

Re: [Numpy-discussion] how to tell if a point is inside a polygon

2008-10-16 Thread John Hunter
On Thu, Oct 16, 2008 at 1:25 PM, Rob Hetland <[EMAIL PROTECTED]> wrote: > This question gets asked about once a month on the mailing list. > Perhaps pnpoly could find a permanent home in scipy? (or somewhere?) > Obviously, many would find it useful. It is already in matplotlib In [1]: import mat

Re: [Numpy-discussion] Need **working** code example of 2-D arrays

2008-10-13 Thread John Hunter
On Mon, Oct 13, 2008 at 2:29 PM, Alan G Isaac <[EMAIL PROTECTED]> wrote: > The problem is, you did not just ask > for technical information. You also > accused people of being condescending > and demeaning. But nobody was > condescending or demeaning. As several > people **politely** explained

Re: [Numpy-discussion] efficient way to do this?

2008-09-22 Thread John Hunter
On Mon, Sep 22, 2008 at 10:23 AM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Mon, Sep 22, 2008 at 10:22, Robert Kern <[EMAIL PROTECTED]> wrote: > >> ind2mark = np.asarray((ind[:,np.newaxis] + np.arange(Nmark).flat).clip(0, >> N-1) >> marked[ind2mark] = True > > Missing parenthesis: > > ind2mark =

Re: [Numpy-discussion] efficient way to do this?

2008-09-22 Thread John Hunter
On Mon, Sep 22, 2008 at 10:13 AM, Robert Kern <[EMAIL PROTECTED]> wrote: > marked[ind + np.arange(Nmark)] = True That triggers a broadcasting error: Traceback (most recent call last): File "/home/titan/johnh/test.py", line 13, in ? marked3[ind + np.arange(Nmark)] = True ValueError: shape m

[Numpy-discussion] efficient way to do this?

2008-09-22 Thread John Hunter
I have a an array of indices into a larger array where some condition is satisfied. I want to create a larger set of indices which *mark* all the indicies following the condition over some Nmark length window. In code: import numpy as np N = 1000 Nmark = 20 ind = np.nonzero(np.r

Re: [Numpy-discussion] strange seterr persistence between sessions

2008-07-28 Thread John Hunter
On Mon, Jul 28, 2008 at 2:35 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > Both, if the behavior exhibits itself without the npy file. If it only > exhibits itself with an npy involved, then we have some more > information about where the problem might be. OK, I'll see what I can come up with. In

Re: [Numpy-discussion] strange seterr persistence between sessions

2008-07-28 Thread John Hunter
On Mon, Jul 28, 2008 at 2:02 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Mon, Jul 28, 2008 at 13:56, John Hunter <[EMAIL PROTECTED]> wrote: >> In trying to track down a bug in matplotlib, I have come across tsome >> very strange numpy behavior. Basically, whether

[Numpy-discussion] strange seterr persistence between sessions

2008-07-28 Thread John Hunter
In trying to track down a bug in matplotlib, I have come across tsome very strange numpy behavior. Basically, whether or not I call np.seterr('raise') or not in a matplotlib demo affects the behavior of seterr in another (pure numpy) script, run in a separate process. Something about the numpy sta

Re: [Numpy-discussion] RFC: A (second) proposal for implementing some date/time types in NumPy

2008-07-25 Thread John Hunter
On Fri, Jul 25, 2008 at 8:22 PM, Matt Knox <[EMAIL PROTECTED]> wrote: > The automatic string parsing has been mentioned before, but it is a feature > I am personally very fond of. I use it all the time, and I suspect a lot of > people would like it very much if they used it. It's not suited for hi

Re: [Numpy-discussion] permissions on tests in numpy and scipy

2008-07-15 Thread John Hunter
On Mon, Jul 14, 2008 at 12:34 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > We're not doing anything special, here. When I install using "sudo > python install.py" on OS X, all of the permissions are 644. I think > the problem may be in your pipeline. With a little more testing, what I am finding

[Numpy-discussion] permissions on tests in numpy and scipy

2008-07-14 Thread John Hunter
I have a rather unconventional install pipeline at work and owner only read permissions on a number of the tests are causing me minor problems. It appears the permissions on the tests are set rather inconsistently in numpy and python -- is there any reason not to make these all 644? [EMAIL PROTEC

Re: [Numpy-discussion] RFC: A proposal for implementing some date/time types in NumPy

2008-07-12 Thread John Hunter
On Fri, Jul 11, 2008 at 1:14 PM, Francesc Alted <[EMAIL PROTECTED]> wrote: > So, it seems that setters/getters for matplotlib datetime could be > supported, maybe at the risk of loosing precision. We should study > this more carefully, but I suppose that if there is interest enough > that could b

[Numpy-discussion] sampling based on running sums

2008-06-27 Thread John Hunter
I would like to find the sample points where the running sum of some vector exceeds some threshold -- at those points I want to collect all the data in the vector since the last time the criteria was reached and compute some stats on it. For example, in python tot = 0. xs = [] ys = []

Re: [Numpy-discussion] Record arrays

2008-06-26 Thread John Hunter
On Thu, Jun 26, 2008 at 11:38 AM, Travis E. Oliphant <[EMAIL PROTECTED]> wrote: > Stéfan van der Walt wrote: >> Hi all, >> >> I am documenting `recarray`, and have a question: >> >> Is its use still recommended, or has it been superseded by fancy data-types? >> > I rarely recommend it's use (but so

Re: [Numpy-discussion] New documentation web application

2008-05-31 Thread John Hunter
On Sat, May 31, 2008 at 4:05 AM, R. Bastian <[EMAIL PROTECTED]> wrote: >> Neat! I really like the layout. The red format warnings are a nice touch: >> http://sd-2116.dedibox.fr/pydocweb/doc/numpy.core.umath.exp/ Hi, I was just reading through this example when I noticed this usage: from matp

[Numpy-discussion] logical masking, wrong length mask

2008-05-28 Thread John Hunter
I just spent a while tracking down a bug in my code, and found out the problem was numpy was letting me get away with using a logical mask of smaller size than the array it was masking. In [19]: x = np.random.rand(10) In [20]: x Out[20]: array([ 0.72253623, 0.8412243 , 0.12835194, 0.01

Re: [Numpy-discussion] numpy.save bug on solaris x86 w/ nans and objects

2008-05-20 Thread John Hunter
On Tue, May 20, 2008 at 12:13 PM, Charles R Harris <[EMAIL PROTECTED]> wrote: > Looks like we need to add a test for this before release. But I'm off to > work. Here's a simpler example in case you want to wrap it in a test harness: import datetime import numpy as np r = np.rec.fromarrays([

[Numpy-discussion] numpy.save bug on solaris x86 w/ nans and objects

2008-05-20 Thread John Hunter
I have a record array w/ dates (O4) and floats. If some of these floats are NaN, np.save crashes (on my solaris platform but not on a linux machine I tested on). Here is the code that produces the bug: In [1]: pwd Out[1]: '/home/titan/johnh/python/svn/matplotlib/matplotlib/examples/data' In [2]

[Numpy-discussion] contiguous true

2008-02-29 Thread John Hunter
[apologies if this is a resend, my mail just flaked out] 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 In [101]: x = np.random.rand(20)>.4 In [102]: x Out[102]: array([False, True, True, False, False, True, True, F

[Numpy-discussion] bug in numpy.histogram?

2008-02-20 Thread John Hunter
We recently deprecated matplotlib.mlab.hist, and I am now hitting a bug in numpy's historgram, which appears to be caused by the use of "any" that does not exist in the namespace. Small patch attached. The example below exposes the bug: Python 2.4.2 (#1, Feb 23 2006, 12:48:31) Type "copyright", "

[Numpy-discussion] major changes in matplotlib svn

2008-01-08 Thread John Hunter
Apologies for the off-topic post to the numpy list, but we have just committed some potentially code-breaking changes to the matplotlib svn repository, and we want to gve as wide a notification to people as possible. Please do not reply to the numpy list, but rather to a matplotlib mailing list .

Re: [Numpy-discussion] display numpy array as image

2007-12-03 Thread John Hunter
On Dec 3, 2007 12:00 PM, Zachary Pincus <[EMAIL PROTECTED]> wrote: > Thanks -- I hadn't realized matplotlib's user-interaction abilities > were that sophisticated! I'll definitely give that route a shot. Here is another example which will help you understand how to do interaction. You can drag t

Re: [Numpy-discussion] boolean masks & lists

2007-11-06 Thread John Hunter
On Nov 6, 2007 8:22 AM, Lisandro Dalcin <[EMAIL PROTECTED]> wrote: > Mmm... > It looks as it 'mask' is being inernally converted from > [True, False, False, False, True] > to > [1, 0, 0, 0, 1] Yep, clearly. The question is: is this the desired behavior because it leads to a "silent failure" for p

[Numpy-discussion] boolean masks & lists

2007-11-05 Thread John Hunter
A colleague of mine just asked for help with a pesky bug that turned out to be caused by his use of a list of booleans rather than an array of booleans as his logical indexing mask. I assume this is a feature and not a bug, but it certainly surprised him: In [58]: mask = [True, False, False, Fals

[Numpy-discussion] trailing max

2007-10-30 Thread John Hunter
In financial time series, it is very common to keep track of things like a trailing N day max, trailing N day average, etc. Generally, for a 1D array x, I'd like to be able to efficiently compute a new len(x) vector where y[i] = func(x[i-N:]) and I need to be able to handle edge effects (eg where

[Numpy-discussion] convolution and wiener khinchin

2007-10-25 Thread John Hunter
I am working on an example to illustrate convolution in the temporal and spectral domains, using the property that a convolution in the time domain is a multiplication in the fourier domain. I am using numpy.fft and numpy.convolve to compute the solution two ways, and comparing them. I am getting

Re: [Numpy-discussion] adding field to rec array

2007-10-05 Thread John Hunter
On 9/26/07, Robert Kern <[EMAIL PROTECTED]> wrote: > Here is the straightforward way: > > In [15]: import numpy as np > > In [16]: dt = np.dtype([('foo', int), ('bar', float)]) > > In [17]: r = np.zeros((3,3), dtype=dt) Here is a (hopefully) simple question. If I create an array like this, how c

[Numpy-discussion] adding field to rec array

2007-09-26 Thread John Hunter
I have a record array r and I want to add a new field to it. I have been looking at setfield but I am not sure how to use it for this purpose. Eg # r is some npy record array N = len(r) x = npy.zeros(N) # add array of floats x to r with dtype name 'jdh' and type 'http://projects.scipy.org/mailma

[Numpy-discussion] corrcoef

2007-09-06 Thread John Hunter
Is it desirable that numpy.corrcoef for two arrays returns a 2x2 array rather than a scalar In [10]: npy.corrcoef(npy.random.rand(10), npy.random.rand(10)) Out[10]: array([[ 1., -0.16088728], [-0.16088728, 1.]]) I always end up extracting the 0,1 element anyway. What is

Re: [Numpy-discussion] Maskedarray implementations

2007-08-25 Thread John Hunter
On 8/24/07, Travis Oliphant <[EMAIL PROTECTED]> wrote: > I like the direction of this work. For me, the biggest issue is whether > or not matplotlib (and other code depending on numpy.ma) works with it. > I'm pretty sure this can be handled and so, I'd personally like to see it. mpl already suppo

Re: [Numpy-discussion] convert csv file into recarray without pre-specifying dtypes and variable names

2007-07-06 Thread John Hunter
On 7/6/07, Vincent Nijs <[EMAIL PROTECTED]> wrote: > I wrote the attached (small) program to read in a text/csv file with > different data types and convert it into a recarray without having to > pre-specify the dtypes or variables names. I am just too lazy to type-in > stuff like that :) The suppo

[Numpy-discussion] problem setting O type for datetime field in record arrays

2007-06-14 Thread John Hunter
I can create a record array with datetime types using fromrecords if I don't specify a dtype and let numpy determine the dtype. But when I try and set the dtype at record array creation time, I get the error below In [17]: import numpy In [18]: import datetime In [19]: dt = datetime.datetime I

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

2007-06-14 Thread John Hunter
On 6/13/07, Pierre GM <[EMAIL PROTECTED]> wrote: > Have you tried mrecords, in the alternative maskedarray package available on > the scipy SVN ? It should support masked fields (by opposition to masked > records in numpy.core.ma). If not, would you mind giving a test and letting > me know your su

[Numpy-discussion] attribute names on record arrays

2007-06-13 Thread John Hunter
I fund myself using record arrays more and more, and feature missing is the ability to do tab completion on attribute names in ipython, presumably because you are using a dict under the hood and __getattr__ to resolve o.key where o is a record array and key is a field name. How hard would it be

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

2007-06-12 Thread John Hunter
On 6/12/07, Robert Kern <[EMAIL PROTECTED]> wrote: > John Hunter wrote: > > Do record arrays support masks? > > I believe so, but not individual masks for each component in the record. I see, too bad. I am working on the matplotlib.mlab.csv2rec function and need to handle mi

[Numpy-discussion] masked arrays and record arrays

2007-06-12 Thread John Hunter
Do record arrays support masks? JDH ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] build advice

2007-05-31 Thread John Hunter
On 5/31/07, Matthew Brett <[EMAIL PROTECTED]> wrote: > Hi, > > > That would get them all built as a cohesive set. Then I'd repeat the > > installs without PYTHONPATH: > > Is that any different from: > cd ~/src >cd numpy >python setup.py build >cd ../scipy >python setup.py build We

[Numpy-discussion] build advice

2007-05-31 Thread John Hunter
A colleague of mine is trying to update our production environment with the latest releases of numpy, scipy, mpl and ipython, and is worried about the lag time when there is a new numpy and old scipy, etc... as the build progresses. This is the scheme he is considering, which looks fine to me, but

[Numpy-discussion] pretty printing record array element - datetime

2007-05-15 Thread John Hunter
I have a numpy record array and I want to pretty print a single element. I was trying to loop over the names in the element dtype and use getattr to access the field value, but I got fouled up because getattr is trying to access the dtype attribute of one of the python objects (datetime.date) that

Re: [Numpy-discussion] [Matplotlib-users] Python issue of Computing in Science and Engineering available

2007-04-25 Thread John Hunter
On 4/25/07, Fernando Perez <[EMAIL PROTECTED]> wrote: > Since authors are allowed by their publication policy to keep a > publicly available copy of their papers on their personal website, > here's the ipython one: Didn't know that... here's a link to my matplotlib article http://nitace.bsd.uchi

[Numpy-discussion] pretty print array

2007-03-03 Thread John Hunter
I have a numpy array of floats, and would like an easy way of specifying the format string when printing the array, eg print x.pprint('%1.3f') would do the normal repr of the array but using my format string for the individual elements. Is there and easy way to get something like this currently?

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

2006-12-20 Thread John Hunter
> "David" == David Cournapeau <[EMAIL PROTECTED]> writes: David> Of this 300 ms spent in Colormap functor, 200 ms are taken David> by the take function: this is the function which I think David> can be speed up considerably. Sorry I had missed this in the previous conversations.

  1   2   >