Re: [Numpy-discussion] record arrays initialization

2012-05-02 Thread Kevin Jacobs
On Wed, May 2, 2012 at 7:25 PM, Aronne Merrelli wrote: > In general this is a good suggestion - I was going to mention it > earlier - but I think for this particular problem it is not better > than the "brute force" and argmin() NumPy approach. On my laptop, the > KDTree query is about a factor of

Re: [Numpy-discussion] record arrays initialization

2012-05-02 Thread Kevin Jacobs
On Wed, May 2, 2012 at 5:45 PM, Moroney, Catherine M (388D) < catherine.m.moro...@jpl.nasa.gov> wrote: > Thanks to Perry for some very useful off-list conversation. I realize > that > I wasn't being clear at all in my earlier description of the problem so > here it is > in a nutshell: > > Find t

Re: [Numpy-discussion] ANN: carray 0.3 released

2010-12-23 Thread Kevin Jacobs
On Wed, Dec 22, 2010 at 1:58 PM, Francesc Alted wrote: > >>> %time b = ca.zeros(1e12) > CPU times: user 54.76 s, sys: 0.03 s, total: 54.79 s > Wall time: 55.23 s > I know this is somewhat missing the point of your demonstration, but 55 seconds to create an empty 3 GB data structure to represe

Re: [Numpy-discussion] ANN: NumPy 1.5.0 release candidate 1

2010-08-26 Thread Kevin Jacobs
On Thu, Aug 26, 2010 at 7:30 AM, Ralf Gommers wrote: > I am pleased to announce the availability of the first release candidate > of NumPy 1.5.0. This will be the first NumPy release to include support > for Python 3, as well as for Python 2.7. > > Please try this RC and report any problems on the

Re: [Numpy-discussion] Unable to get most basic numpy array creation from C++ working.

2010-07-30 Thread Kevin Jacobs
On Fri, Jul 30, 2010 at 10:08 PM, rif wrote: > Hi numpy-discuss > . > I've distilled my problem down to a very simple program that segfaults. > I'm sure I'm doing something silly, but hopefully someone can point me in > the right direction. I create a program called numpy_test.cc: > > You must c

Re: [Numpy-discussion] pareto docstring

2010-05-11 Thread Kevin Jacobs
On Tue, May 11, 2010 at 4:14 AM, Pauli Virtanen wrote: > A third option would be just to silently fix the bug. In any case the > change should be mentioned noticeably in the release notes. > > I see this as two bugs: the Lomax distribution was named incorrectly and the Parato distribution was inc

Re: [Numpy-discussion] Recommended way to add Cython extension using numpy.distutils?

2010-04-28 Thread Kevin Jacobs
On Tue, Apr 27, 2010 at 8:09 PM, Matthew Brett wrote: > Hi, > > We (neuroimaging.scipy.org) are using numpy.distutils, and we have > .pyx files that we build with Cython. > > I wanted to add these in our current setup.py scripts, with something like: > > def configuration(parent_package='',top_pat

Re: [Numpy-discussion] f2py: "could not crack entity declaration"

2010-03-27 Thread Kevin Jacobs
On Fri, Mar 26, 2010 at 7:07 PM, David Warde-Farley wrote: > On 26-Mar-10, at 4:25 PM, David Warde-Farley wrote: > > > That said, I gave that wrapper a whirl and it crashed on me... > > > > I noticed you added an 'njd' argument to the wrapper for elnet, did > > you modify the elnet Fortran functi

Re: [Numpy-discussion] f2py: "could not crack entity declaration"

2010-03-26 Thread Kevin Jacobs
On Thu, Mar 25, 2010 at 6:25 PM, David Warde-Farley wrote: > I decided to give wrapping this code a try: > >http://morrislab.med.utoronto.ca/~dwf/GLMnet.f90 > > > I have a working f2py wrapper located at: http://code.google.com/p/glu-genetics/source/browse/trunk/glu/lib/glm/glmnet.pyf I'

Re: [Numpy-discussion] Please don't use google code for hosting

2009-01-16 Thread Kevin Jacobs
Google code for my project. Maybe it would be best to address this limitation with Google directly. -Kevin Jacobs ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Mersenne twister seeds

2008-12-15 Thread Kevin Jacobs
On Mon, Dec 15, 2008 at 6:01 PM, Michael Gilbert < michael.s.gilb...@gmail.com> wrote: > According to wikipedia [1], some common Mersenne twister algorithms > use a linear congruential gradient (LCG) to generate seeds. LCGs have > been known to produce poor random numbers. Does numpy's Mersenne

Re: [Numpy-discussion] trouble subclassing ndarray

2008-12-03 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On Wed, Dec 3, 2008 at 9:19 AM, Sébastien Barthélemy <[EMAIL PROTECTED]>wrote: >def inv_v1(self): >self[0:4,0:4] = htr.inv(self) >def inv_v2(self): >data = htr.inv(self) >self = HomogeneousMatrix(data) >def inv_v3(self): >self = htr.inv(self) > self is

Re: [Numpy-discussion] statistical model fitting & comparison

2008-10-21 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On Tue, Oct 21, 2008 at 5:01 PM, Bruce Southey <[EMAIL PROTECTED]> wrote: > I think you are on your own here as it is a huge chunk to chew! > Depending on what you really mean by linear models is also part of that > (the Wikipedia entry is amusing). Most people probably to stats > applications lik

Re: [Numpy-discussion] min() of array containing NaN

2008-08-13 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On Wed, Aug 13, 2008 at 4:01 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Wed, Aug 13, 2008 at 14:37, Joe Harrington <[EMAIL PROTECTED]> wrote: > >>On Tue, Aug 12, 2008 at 19:28, Charles R Harris > >><[EMAIL PROTECTED]> wrote: > >>> > >>> > >>> On Tue, Aug 12, 2008 at 5:13 PM, Andrew Dalke < >

Re: [Numpy-discussion] min() of array containing NaN

2008-08-12 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On Tue, Aug 12, 2008 at 1:46 AM, Andrew Dalke <[EMAIL PROTECTED]>wrote: > Here's the implementation, from lib/function_base.py > > def nanmin(a, axis=None): > """Find the minimium over the given axis, ignoring NaNs. > """ > y = array(a,subok=True) > if not issubclass(y.dtype.type,

Re: [Numpy-discussion] patches to reduce import costs

2008-07-31 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On Thu, Jul 31, 2008 at 7:08 PM, Christopher Burns <[EMAIL PROTECTED]>wrote: > Do you mean add a file on the Wiki or in the source tree somewhere? > Either or both-- so long as there is a convenient place to find them. I suppose a Wiki page would be most flexible, since it could be expanded to

Re: [Numpy-discussion] patches to reduce import costs

2008-07-31 Thread Kevin Jacobs <[EMAIL PROTECTED]>
For the help of freeze packages, it would be great if you could add a file that lists all of the deferred imports that you run across. That way, we can add/update recipes more easily for py2app, py2exe, bbfreeze, etc. Thanks, -Kevin On Thu, Jul 31, 2008 at 4:44 PM, Andrew Dalke <[EMAIL PROTECTE

Re: [Numpy-discussion] [ANNOUNCE] Traits 3.0 has been released

2008-07-31 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On Wed, Jul 30, 2008 at 9:25 PM, Dave Peterson <[EMAIL PROTECTED]>wrote: > Hello, > > I am very pleased to announce that Traits 3.0 has just been released! > > All of the URLs on PyPi to Enthought seem to be broken (e.g., http://code.enthought.com/traits). Can you give an example showing how trai

Re: [Numpy-discussion] "import numpy" is slow

2008-07-31 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On Thu, Jul 31, 2008 at 10:14 AM, Gael Varoquaux < [EMAIL PROTECTED]> wrote: > On Thu, Jul 31, 2008 at 12:43:17PM +0200, Andrew Dalke wrote: > > Startup performance has not been a numpy concern. It a concern for > > me, and it has been (for other packages) a concern for some of my > > clients. >

Re: [Numpy-discussion] ANN: PyCuda

2008-06-22 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On Sun, Jun 22, 2008 at 3:58 PM, Andreas Klöckner <[EMAIL PROTECTED]> wrote: > PyCuda is based on the driver API. CUBLAS uses the high-level API. Once > *can* > violate this rule without crashing immediately. But sketchy stuff does > happen. Instead, for BLAS-1 operations, PyCuda comes with a clas

Re: [Numpy-discussion] Fancier indexing

2008-05-22 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On Thu, May 22, 2008 at 12:08 PM, Keith Goodman <[EMAIL PROTECTED]> wrote: > How big is n? If it is much smaller than a million then loop over that > instead. > n is always relatively small, but I'd rather not do: for i in range(n): counts[i] = (items==i).sum() If that was the best alternativ

[Numpy-discussion] Fancier indexing

2008-05-22 Thread Kevin Jacobs <[EMAIL PROTECTED]>
After poking around for a bit, I was wondering if there was a faster method for the following: # Array of index values 0..n items = numpy.array([0,3,2,1,4,2],dtype=int) # Count the number of occurrences of each index counts = numpy.zeros(5, dtype=int) for i in items: counts[i] += 1 In my real

Re: [Numpy-discussion] varu and stdu

2008-04-07 Thread Kevin Jacobs <[EMAIL PROTECTED]>
I know I'm off topic and maybe a day late, but I'm pained by the naming of ddof. It is simply not intuitive for anyone other than the person who thought it up (and from my recollection, maybe not even for him).For one, most stats folk use 'df' as the abbreviation for 'degrees of freedom'. Sec

Re: [Numpy-discussion] parallel numpy (by Brian Granger) - any info?

2008-01-08 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On 1/8/08, Matthieu Brucher <[EMAIL PROTECTED]> wrote: > > I have AMD processor so I guess I should use ACML somehow instead. > > However, at 1st I would prefer my code to be platform-independent, and > > at 2nd unfortunately I haven't encountered in numpy documentation (in > > website scipy.org an

Re: [Numpy-discussion] [C++-sig] Overloading sqrt(5.5)*myvector

2007-12-27 Thread Kevin Jacobs <[EMAIL PROTECTED]>
Hi Bruce, I have to add that I don't know the answer to your question either, but I do know that it is solvable and that once the list experts return, enlightenment will soon follow. My confidence comes from knowing the Python internals for how left and right multiplication are performed. As lon

Re: [Numpy-discussion] expm

2007-07-20 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On 7/20/07, Kevin Jacobs <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote: On 7/20/07, Charles R Harris <[EMAIL PROTECTED]> wrote: > > I expect using sqrt(x) will be faster than x**.5. > I did test this at one point and was also surprised that sqrt(x) seemed slower than

Re: [Numpy-discussion] expm

2007-07-20 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On 7/20/07, Charles R Harris <[EMAIL PROTECTED]> wrote: I expect using sqrt(x) will be faster than x**.5. I did test this at one point and was also surprised that sqrt(x) seemed slower than **.5. However I found out otherwise while preparing a timeit script to demonstrate this observation.

Re: [Numpy-discussion] expm

2007-07-20 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On 7/20/07, Nils Wagner <[EMAIL PROTECTED]> wrote: Your sqrtm_eig(x) function won't work if x is defective. See test_defective.py for details. I've added several defective matrices to my test cases and the SVD method doesn't work well as I'd thought (which is obvious in retrospect). I'm goi

Re: [Numpy-discussion] expm

2007-07-20 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On 7/20/07, Nils Wagner <[EMAIL PROTECTED]> wrote: Your sqrtm_eig(x) function won't work if x is defective. See test_defective.py for details. I am aware, though at least on my system, the SVD-based method is by far the fastest and robust (and can be made more robust by the addition of a rela

Re: [Numpy-discussion] expm

2007-07-20 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On 7/20/07, Anne Archibald <[EMAIL PROTECTED]> wrote: On 20/07/07, Nils Wagner <[EMAIL PROTECTED]> wrote: > lorenzo bolla wrote: > > hi all. > > is there a function in numpy to compute the exp of a matrix, similar > > to expm in matlab? > > for example: > > expm([[0,0],[0,0]]) = eye(2) > Numpy d

Re: [Numpy-discussion] NumPy/SciPy LAPACK version

2007-07-16 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On 7/16/07, Robert Kern <[EMAIL PROTECTED]> wrote: And we'd certainly appreciate the contribution. I'm tentatively going to say yes, we should start requiring LAPACK 3.0 unless if there is some very important platform that only comes with an older LAPACK. Great! The added benefit is that the

Re: [Numpy-discussion] NumPy/SciPy LAPACK version

2007-07-16 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On 7/16/07, Charles R Harris <[EMAIL PROTECTED]> wrote: Hmm, I get a real result for this, although the result is wildly incorrect. Sqrtm isn't part of numpy, where are you getting it from? Mine is coming from pylab and looks remarkably buggy. from scipy.linalg import sqrtm I'm posting on

Re: [Numpy-discussion] NumPy/SciPy LAPACK version

2007-07-16 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On 7/16/07, Kevin Jacobs <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote: This is a bit of a SciPy question, but I thought I'd ask here since I'm already subscribed. I'd like to add some new LAPACK bindings to SciPy and was wondering if there was a minimum version re

Re: [Numpy-discussion] NumPy/SciPy LAPACK version

2007-07-16 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On 7/16/07, Charles R Harris <[EMAIL PROTECTED]> wrote: On 7/16/07, Robert Kern <[EMAIL PROTECTED]> wrote: > > Kevin Jacobs <[EMAIL PROTECTED]> wrote: > > Mea culpa on the msqrt example, however I still think it is wrong to > get > > a complex square

Re: [Numpy-discussion] NumPy/SciPy LAPACK version

2007-07-16 Thread Kevin Jacobs <[EMAIL PROTECTED]>
+7.87335527e-08j, -51.27477788 -2.21716697e-07j, -43.21448471 +1.42983144e-07j]]) >>> This certainly is a slightly unexpected behaviour. Hanno "Kevin Jacobs <[EMAIL PROTECTED]>" <[EMAIL PROTECTED]> said: > --=_Part_59405_32758974.1184593945795 >

[Numpy-discussion] NumPy/SciPy LAPACK version

2007-07-16 Thread Kevin Jacobs <[EMAIL PROTECTED]>
Hi all, This is a bit of a SciPy question, but I thought I'd ask here since I'm already subscribed. I'd like to add some new LAPACK bindings to SciPy and was wondering if there was a minimum version requirement for LAPACK, since it would be ideal if I could use some of the newer 3.0 features. I

Re: [Numpy-discussion] Anyone written an SQL-like interface to numpy/PyTables?

2007-06-18 Thread Kevin Jacobs <[EMAIL PROTECTED]>
I've often thought it would be interesting if someone would build a custom table adapter to use PyTables in SQLlite. Ie, essentially bolting a SQL parser and query engine on top of PyTables. Unfortunately, I don't have time to do this, though hopefully someone will at some point. -Kevin On 6/

Re: [Numpy-discussion] randint for long type (permutations)

2007-06-14 Thread Kevin Jacobs <[EMAIL PROTECTED]>
Call randint until you get enough bits of entropy to for a long with the appropriate number of bits. def randwords(n): result = 0L for i in range(n): result = (result<<32) | randint(0,2<<32-1) return result -Kevin On 6/14/07, Will Woods <[EMAIL PROTECTED]> wrote: I want to choose a su

Re: [Numpy-discussion] bug in http://www.scipy.org/NumPy_for_Matlab_Users

2007-04-29 Thread Kevin Jacobs <[EMAIL PROTECTED]>
On 4/29/07, Andrew Straw <[EMAIL PROTECTED]> wrote: No, the nth index of a Python sequence is a[n], where n starts from zero. Thus, if I want the nth dimension of array a, I want a.shape[n]. I reverted the page to its original form and added a couple explanatory comments about zero vs one based

Re: [Numpy-discussion] Assembling an array from parts

2007-04-01 Thread Kevin Jacobs <[EMAIL PROTECTED]>
I had to poke around before finding it too: bmat( [[K,G],[G.T, zeros(nc)]] ) On 4/1/07, Bill Baxter <[EMAIL PROTECTED]> wrote: What's the best way of assembling a big matrix from parts? I'm using lagrange multipliers to enforce constraints and this kind of matrix comes up a lot: [[ K, G],

Re: [Numpy-discussion] A surprising result from benchmarking

2007-03-10 Thread Kevin Jacobs <[EMAIL PROTECTED]>
The inefficiency comes in the generic iteration and construction of int objects needed by the builtin sum function. Using the native numarray sum method on each row is much much faster, summing over the axis directly even faster still: t1=time.time() highEnough=myMat>0.6 greaterPerLine=[x.sum()