[Numpy-discussion] magma?

2011-11-18 Thread Neal Becker
Is there any possibility of incorporating this work into numpy? http://icl.cs.utk.edu/magma/software/index.html ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Reading automatically all the parameters from a file

2011-11-30 Thread Neal Becker
My suggestion is: don't. It's easier to script runs if you read parameters from the command line. I recommend argparse. Giovanni Plantageneto wrote: Dear all, I have a simple question. I would like to have all the parameters of a model written in a configuration file (text), and I would like

[Numpy-discussion] choose - segfault

2012-01-03 Thread Neal Becker
I made 2 mistakes here, the 1st argument had the wrong shape, and I really wanted to use 'where', not 'choose'. But shouldn't segfault: ValueError: Need between 2 and (32) array objects (inclusive). Segmentation fault (core dumped) ___

Re: [Numpy-discussion] Numpy 'groupby'

2012-01-11 Thread Neal Becker
Michael Hull wrote: Hi Everyone, First off, thanks for all your hard work on numpy, its a really great help! I was wondering if there was a standard 'groupby' in numpy, that similar to that in itertools. I know its not hard to write with np.diff, but I have found myself writing it on more

[Numpy-discussion] numpy all unexpected result (generator)

2012-01-31 Thread Neal Becker
I was just bitten by this unexpected behavior: In [24]: all ([i 0 for i in xrange (10)]) Out[24]: False In [25]: all (i 0 for i in xrange (10)) Out[25]: True Turns out: In [31]: all is numpy.all Out[31]: True So numpy.all doesn't seem to do what I would expect when given a generator. Bug?

Re: [Numpy-discussion] numpy all unexpected result (generator)

2012-01-31 Thread Neal Becker
Dag Sverre Seljebotn wrote: On 01/31/2012 03:07 PM, Robert Kern wrote: On Tue, Jan 31, 2012 at 13:26, Neal Beckerndbeck...@gmail.com wrote: I was just bitten by this unexpected behavior: In [24]: all ([i0 for i in xrange (10)]) Out[24]: False In [25]: all (i0 for i in xrange

Re: [Numpy-discussion] [ANN] new solver for multiobjective optimization problems

2012-02-10 Thread Neal Becker
And where do we find this gem? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-17 Thread Neal Becker
Mark Wiebe wrote: On Fri, Feb 17, 2012 at 11:52 AM, Eric Firing efir...@hawaii.edu wrote: On 02/17/2012 05:39 AM, Charles R Harris wrote: On Fri, Feb 17, 2012 at 8:01 AM, David Cournapeau courn...@gmail.com mailto:courn...@gmail.com wrote: Hi Travis, On Thu, Feb 16,

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-19 Thread Neal Becker
Sturla Molden wrote: Den 19.02.2012 01:12, skrev Nathaniel Smith: I don't oppose it, but I admit I'm not really clear on what the supposed advantages would be. Everyone seems to agree that -- Only a carefully-chosen subset of C++ features should be used -- But this subset would be

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-19 Thread Neal Becker
Nathaniel Smith wrote: On Sun, Feb 19, 2012 at 9:16 AM, David Cournapeau courn...@gmail.com wrote: On Sun, Feb 19, 2012 at 8:08 AM, Mark Wiebe mwwi...@gmail.com wrote: Is there a specific target platform/compiler combination you're thinking of where we can do tests on this? I don't believe

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-19 Thread Neal Becker
Sturla Molden wrote: Den 18. feb. 2012 kl. 01:58 skrev Charles R Harris charlesr.har...@gmail.com: On Fri, Feb 17, 2012 at 4:44 PM, David Cournapeau courn...@gmail.com wrote: I don't think c++ has any significant advantage over c for high performance libraries. I am not convinced by

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-20 Thread Neal Becker
Charles R Harris wrote: On Fri, Feb 17, 2012 at 12:09 PM, Benjamin Root ben.r...@ou.edu wrote: On Fri, Feb 17, 2012 at 1:00 PM, Christopher Jordan-Squire cjord...@uw.edu wrote: On Fri, Feb 17, 2012 at 10:21 AM, Mark Wiebe mwwi...@gmail.com wrote: On Fri, Feb 17, 2012 at 11:52 AM, Eric

[Numpy-discussion] Where is arrayobject.h?

2012-02-21 Thread Neal Becker
What is the correct way to find the installed location of arrayobject.h? On fedora, I had been using: (via scons): import distutils.sysconfig PYTHONINC = distutils.sysconfig.get_python_inc() PYTHONLIB = distutils.sysconfig.get_python_lib(1) NUMPYINC = PYTHONLIB + '/numpy/core/include' But on

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-22 Thread Neal Becker
It's great advice to say avoid using new instead rely on scope and classes such as std::vector. I just want to point out, that sometimes objects must outlive scope. For those cases, std::shared_ptr can be helpful. ___ NumPy-Discussion mailing list

[Numpy-discussion] mkl usage

2012-02-23 Thread Neal Becker
Is mkl only used for linear algebra? Will it speed up e.g., elementwise transendental functions? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] mkl usage

2012-02-23 Thread Neal Becker
Pauli Virtanen wrote: 23.02.2012 20:44, Francesc Alted kirjoitti: On Feb 23, 2012, at 1:33 PM, Neal Becker wrote: Is mkl only used for linear algebra? Will it speed up e.g., elementwise transendental functions? Yes, MKL comes with VML that has this type of optimizations: And also

Re: [Numpy-discussion] mkl usage

2012-02-24 Thread Neal Becker
Francesc Alted wrote: On Feb 23, 2012, at 2:19 PM, Neal Becker wrote: Pauli Virtanen wrote: 23.02.2012 20:44, Francesc Alted kirjoitti: On Feb 23, 2012, at 1:33 PM, Neal Becker wrote: Is mkl only used for linear algebra? Will it speed up e.g., elementwise transendental functions

Re: [Numpy-discussion] Creating a bool array with Cython

2012-02-26 Thread Neal Becker
Keith Goodman wrote: Is this a reasonable (and fast) way to create a bool array in cython? def makebool(): cdef: int n = 2 np.npy_intp *dims = [n] np.ndarray[np.uint8_t, ndim=1] a a = PyArray_EMPTY(1, dims, NPY_UINT8, 0)

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-29 Thread Neal Becker
Charles R Harris wrote: On Tue, Feb 28, 2012 at 12:05 PM, John Hunter jdh2...@gmail.com wrote: On Sat, Feb 18, 2012 at 5:09 PM, David Cournapeau courn...@gmail.comwrote: There are better languages than C++ that has most of the technical benefits stated in this discussion (rust and D

[Numpy-discussion] all elements equal

2012-03-05 Thread Neal Becker
What is a simple, efficient way to determine if all elements in an array (in my case, 1D) are equal? How about close? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] all elements equal

2012-03-05 Thread Neal Becker
Keith Goodman wrote: On Mon, Mar 5, 2012 at 11:14 AM, Neal Becker ndbeck...@gmail.com wrote: What is a simple, efficient way to determine if all elements in an array (in my case, 1D) are equal? How about close? For the exactly equal case, how about: I[1] a = np.array([1,1,1,1]) I[2

Re: [Numpy-discussion] all elements equal

2012-03-05 Thread Neal Becker
Keith Goodman wrote: On Mon, Mar 5, 2012 at 11:52 AM, Benjamin Root ben.r...@ou.edu wrote: Another issue to watch out for is if the array is empty. Technically speaking, that should be True, but some of the solutions offered so far would fail in this case. Good point. For fun, here's

[Numpy-discussion] use for missing (ignored) data?

2012-03-07 Thread Neal Becker
I'm wondering what is the use for the ignored data feature? I can use: A[valid_A_indexes] = whatever to process only the 'non-ignored' portions of A. So at least some simple cases of ignored data are already supported without introducing a new type. OTOH: w = A[valid_A_indexes] will copy

Re: [Numpy-discussion] use for missing (ignored) data?

2012-03-07 Thread Neal Becker
Charles R Harris wrote: On Wed, Mar 7, 2012 at 1:05 PM, Neal Becker ndbeck...@gmail.com wrote: I'm wondering what is the use for the ignored data feature? I can use: A[valid_A_indexes] = whatever to process only the 'non-ignored' portions of A. So at least some simple cases

[Numpy-discussion] unique along axis?

2012-03-12 Thread Neal Becker
I see unique does not take an axis arg. Suggested way to apply unique to each column of a 2d array? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] apply 'getitem to each element of obj array?

2012-04-05 Thread Neal Becker
I have an array of object. How can I apply attribute access to each element? I want to do, for example, np.all (u.some_attribute == 0) for all elements in u? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] apply 'getitem to each element of obj array?

2012-04-05 Thread Neal Becker
Ken Watford wrote: On Thu, Apr 5, 2012 at 11:57 AM, Olivier Delalleau sh...@keba.be wrote: Le 5 avril 2012 11:45, Neal Becker ndbeck...@gmail.com a écrit : You can do: f = numpy.frompyfunc(lambda x: x.some_attribute == 0, 1, 1) Then f(array_of_objects_x) This is handy too: agetattr

Re: [Numpy-discussion] A crazy masked-array thought

2012-04-28 Thread Neal Becker
Nathaniel Smith wrote: On Sat, Apr 28, 2012 at 7:38 AM, Richard Hattersley rhatters...@gmail.com wrote: So, assuming numpy.ndarray became a strict subclass of some new masked array, it looks plausible that adding just a few checks to numpy.ndarray to exclude the masked superclass would

Re: [Numpy-discussion] Quaternion data type

2012-05-07 Thread Neal Becker
I am quite interested in a fixed point data type. I had produced a working model some time ago. Maybe I can use some of these new efforts to provide good examples as a guide. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

[Numpy-discussion] slicing and aliasing

2012-05-31 Thread Neal Becker
Will copying slices always work correctly w/r to aliasing? That is, will: u[a:b] = u[c:d] always work (assuming the ranges of a:b, d:d are equal, or course) ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

[Numpy-discussion] varargs for logical_or, etc

2012-06-05 Thread Neal Becker
I think it's unfortunate that functions like logical_or are limited to binary. As a workaround, I've been using this: def apply_binary (func, *args): if len (args) == 1: return args[0] elif len (args) == 2: return func (*args) else: return func (

Re: [Numpy-discussion] lazy evaluation

2012-06-05 Thread Neal Becker
Would lazy eval be able to eliminate temps in doing operations such as: np.sum (u != 23)? That is, now ops involving selecting elements of matrixes are often performed by first constructing temp matrixes, and the operating on them. ___

[Numpy-discussion] possible enhancement to getitem?

2012-06-07 Thread Neal Becker
In [3]: u = np.arange(10) In [4]: u Out[4]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) In [5]: u[-2:] Out[5]: array([8, 9]) In [6]: u[-2:2] Out[6]: array([], dtype=int64) I would argue for consistency it would be desirable for this to return [8, 9, 0, 1]

Re: [Numpy-discussion] possible enhancement to getitem?

2012-06-08 Thread Neal Becker
Robert Kern wrote: On Thu, Jun 7, 2012 at 7:55 PM, Neal Becker ndbeck...@gmail.com wrote: In [3]: u = np.arange(10) In [4]: u Out[4]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) In [5]: u[-2:] Out[5]: array([8, 9]) In [6]: u[-2:2] Out[6]: array([], dtype=int64) I would argue

[Numpy-discussion] trivial question?

2012-06-20 Thread Neal Becker
Maybe I'm being slow, but is there any convenient function to calculate, for 2 vectors: \sum_i \sum_j x_i y_j (I had a matrix once, but it vanished without a trace) ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

[Numpy-discussion] m-ary logical functions

2012-07-12 Thread Neal Becker
I've been bitten several times by this. logical_or (a, b, c) is silently accepted when I really meant logical_or (logical_or (a, b), c) because the logic functions are binary, where I expected them to be m-ary. Dunno if anything can be done about it. Sure would like it if they were m-ary and

[Numpy-discussion] gnu mpc 1.0 released

2012-07-23 Thread Neal Becker
Perhaps of some interest here: http://lwn.net/Articles/507756/rss ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] blaze lib announcement

2012-08-29 Thread Neal Becker
This looks interesting: http://code.google.com/p/blaze-lib/ ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] broadcasting question

2012-08-30 Thread Neal Becker
I think this should be simple, but I'm drawing a blank I have 2 2d matrixes Matrix A has indexes (i, symbol) Matrix B has indexes (state, symbol) I combined them into a 3d matrix: C = A[:,newaxis,:] + B[newaxis,:,:] where C has indexes (i, state, symbol) That works fine. Now suppose I want

[Numpy-discussion] silently ignored size mismatch (bug??)

2012-09-28 Thread Neal Becker
In [19]: u = np.arange (10) In [20]: v = np.arange (10) In [21]: u[v] = u In [22]: u[v] = np.arange(11) silence... ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] silently ignored size mismatch (bug??)

2012-10-01 Thread Neal Becker
Sounds like I'm not the only one surprised then: http://projects.scipy.org/numpy/ticket/2220 Matthew Brett wrote: Hi, On Mon, Oct 1, 2012 at 9:04 AM, Pierre Haessig pierre.haes...@crans.org wrote: Hi, Le 28/09/2012 21:02, Neal Becker a écrit : In [19]: u = np.arange (10) In [20]: v

[Numpy-discussion] print array in a form that can then be input

2012-10-20 Thread Neal Becker
I find it annoying that in casual use, if I print an array, that form can't be directly used as subsequent input (or can it?). What do others do about this? When I say casual, what I mean is, I write some long-running task and at the end, print some small array. Now I decide I'd like to

[Numpy-discussion] yet another trivial question

2012-11-02 Thread Neal Becker
I'm trying to convert some matlab code. I see this: b(1)=[]; AFAICT, this removes the first element of the array, shifting the others. What is the preferred numpy equivalent? I'm not sure if b[:] = b[1:] is safe or not ___ NumPy-Discussion

[Numpy-discussion] testing with amd libm/acml

2012-11-07 Thread Neal Becker
I'm trying to do a bit of benchmarking to see if amd libm/acml will help me. I got an idea that instead of building all of numpy/scipy and all of my custom modules against these libraries, I could simply use:

Re: [Numpy-discussion] testing with amd libm/acml

2012-11-07 Thread Neal Becker
David Cournapeau wrote: On Wed, Nov 7, 2012 at 12:35 PM, Neal Becker ndbeck...@gmail.com wrote: I'm trying to do a bit of benchmarking to see if amd libm/acml will help me. I got an idea that instead of building all of numpy/scipy and all of my custom modules against these libraries, I could

Re: [Numpy-discussion] testing with amd libm/acml

2012-11-07 Thread Neal Becker
David Cournapeau wrote: On Wed, Nov 7, 2012 at 1:56 PM, Neal Becker ndbeck...@gmail.com wrote: David Cournapeau wrote: On Wed, Nov 7, 2012 at 12:35 PM, Neal Becker ndbeck...@gmail.com wrote: I'm trying to do a bit of benchmarking to see if amd libm/acml will help me. I got an idea

Re: [Numpy-discussion] testing with amd libm/acml

2012-11-07 Thread Neal Becker
David Cournapeau wrote: On Wed, Nov 7, 2012 at 1:56 PM, Neal Becker ndbeck...@gmail.com wrote: David Cournapeau wrote: On Wed, Nov 7, 2012 at 12:35 PM, Neal Becker ndbeck...@gmail.com wrote: I'm trying to do a bit of benchmarking to see if amd libm/acml will help me. I got an idea

Re: [Numpy-discussion] testing with amd libm/acml

2012-11-07 Thread Neal Becker
Would you expect numexpr without MKL to give a significant boost? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] numexpr question

2012-11-08 Thread Neal Becker
I'm interested in trying numexpr, but have a question (not sure where's the best forum to ask). The examples I see use ne.evaluate (some string...) When used within a loop, I would expect the compilation from the string form to add significant overhead. I would have thought a pre-compiled

[Numpy-discussion] confused about univaritespline

2012-11-20 Thread Neal Becker
I don't understand why the plot of the spline continues on a negative slope at the end, but the plot of the integral of it flattens. - import numpy as np import matplotlib.pyplot as plt ibo = np.array ((12, 14, 16, 18, 20, 22, 24, 26, 28, 29,

Re: [Numpy-discussion] confused about univaritespline

2012-11-20 Thread Neal Becker
Pauli Virtanen wrote: 20.11.2012 21:11, Neal Becker kirjoitti: import numpy as np import matplotlib.pyplot as plt ibo = np.array ((12, 14, 16, 18, 20, 22, 24, 26, 28, 29, 29.8, 30.2)) gain_deriv = np.array ((0, 0, 0, 0, 0, 0, .2, .4, .5, .5, 0,-2)) import scipy.interpolate s

[Numpy-discussion] non-integer index misfeature?

2012-12-11 Thread Neal Becker
I think it's a misfeature that a floating point is silently accepted as an index. I would prefer a warning for: bins = np.arange (...) for b in bins: ... w[b] = blah when I meant: for ib,b in enumerate (bins): w[ib] = blah ___ NumPy-Discussion

Re: [Numpy-discussion] non-integer index misfeature?

2012-12-13 Thread Neal Becker
I'd be happy with disallowing floating point index at all. I would think it was almost always a mistake. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] ANN: NumPy 1.7.0rc1 release

2012-12-29 Thread Neal Becker
Are release notes available? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] phase unwrapping (1d)

2013-01-11 Thread Neal Becker
np.unwrap was too slow, so I rolled by own (in c++). I wanted to be able to handle the case of unwrap (arg (x1) + arg (x2)) Here, phase can change by more than 2pi. I came up with the following algorithm, any thoughts? In the following, y is normally set to pi. o points to output i points to

Re: [Numpy-discussion] phase unwrapping (1d)

2013-01-14 Thread Neal Becker
Nadav Horesh wrote: There is an unwrap function in numpy. Doesn't it work for you? Like I had said, np.unwrap was too slow. Profiling showed it eating up an absurd proportion of time. My c++ code was much better (although still surprisingly slow).

Re: [Numpy-discussion] phase unwrapping (1d)

2013-01-14 Thread Neal Becker
* np.sin (u) plot (arg(v)) plot (arg(v) + arg (v)) plot (unwrap (arg (v))) plot (unwrap (arg (v) + arg (v))) --- Pierre Haessig wrote: Hi Neal, Le 11/01/2013 16:40, Neal Becker a écrit : I wanted to be able to handle the case of unwrap (arg (x1) + arg (x2)) Here

[Numpy-discussion] find points unique within some epsilon

2013-01-16 Thread Neal Becker
Any suggestion how to take a 2d complex array and find the set of points that are unique within some tolerance? (My preferred metric here would be Euclidean distance) ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

[Numpy-discussion] another little index puzzle

2013-01-21 Thread Neal Becker
I have an array to be used for indexing. It is 2d, where the rows are all the permutations of some numbers. So: array([[-2, -2, -2], [-2, -2, -1], [-2, -2, 0], [-2, -2, 1], [-2, -2, 2], ... [ 2, 1, 2], [ 2, 2, -2], [ 2, 2, -1], [

Re: [Numpy-discussion] ANN: NumPy 1.7.0 release

2013-02-09 Thread Neal Becker
Is there a way to add '-march=native' flag to gcc for the build? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] confused about tensordot

2013-02-15 Thread Neal Becker
In the following code c = np.multiply (a, b.conj()) d = np.abs (np.sum (c, axis=0)/rows) d2 = np.abs (np.tensordot (a, b.conj(), ((0,),(0,)))/rows) print a.shape, b.shape, d.shape, d2.shape The 1st compute steps, where I do multiply and then sum

Re: [Numpy-discussion] confused about tensordot

2013-02-15 Thread Neal Becker
Bradley M. Froehle wrote: Hi Neal: The tensordot part: np.tensordot (a, b.conj(), ((0,),(0,)) is returning a (13, 13) array whose [i, j]-th entry is sum( a[k, i] * b.conj()[k, j] for k in xrange(1004) ). -Brad The print statement outputs this: (1004, 13) (1004, 13) (13,)

Re: [Numpy-discussion] FFTW bindings now implement numpy.fft interface

2013-02-17 Thread Neal Becker
Henry Gomersall wrote: Some of you may be interested in the latest release of my FFTW bindings. It can now serve as a drop in replacement* for numpy.fft and scipy.fftpack. This means you can get most of the speed-up of FFTW with a one line code change or monkey patch existing libraries.

[Numpy-discussion] savetxt trouble

2013-02-20 Thread Neal Becker
I tried to save a vector as a csv, but it didn't work. The vector is: a[0,0] array([-0.70710678-0.70710678j, 0.70710678+0.70710678j, 0.70710678-0.70710678j, 0.70710678+0.70710678j, -0.70710678-0.70710678j, 0.70710678-0.70710678j, -0.70710678+0.70710678j,

Re: [Numpy-discussion] savetxt trouble

2013-02-20 Thread Neal Becker
Robert Kern wrote: On Wed, Feb 20, 2013 at 1:25 PM, Neal Becker ndbeck...@gmail.com wrote: I tried to save a vector as a csv, but it didn't work. The vector is: a[0,0] array([-0.70710678-0.70710678j, 0.70710678+0.70710678j, 0.70710678-0.70710678j, 0.70710678+0.70710678j

Re: [Numpy-discussion] Adopt Mersenne Twister 64bit?

2013-03-12 Thread Neal Becker
Nathaniel Smith wrote: On Tue, Mar 12, 2013 at 9:25 PM, Nathaniel Smith n...@pobox.com wrote: On Mon, Mar 11, 2013 at 9:46 AM, Robert Kern robert.k...@gmail.com wrote: On Sun, Mar 10, 2013 at 6:12 PM, Siu Kwan Lam s...@continuum.io wrote: My suggestion to overcome (1) and (2) is to allow the

Re: [Numpy-discussion] Adopt Mersenne Twister 64bit?

2013-03-12 Thread Neal Becker
I guess I talked to you about 100 years ago about sharing state between numpy rng and code I have in c++ that wraps boost::random. So is there a C-api for this RandomState object I could use to call from c++? Maybe I could do something with that. The c++ code could invoke via the python api,

Re: [Numpy-discussion] Adopt Mersenne Twister 64bit?

2013-03-12 Thread Neal Becker
Neal Becker wrote: I guess I talked to you about 100 years ago about sharing state between numpy rng and code I have in c++ that wraps boost::random. So is there a C-api for this RandomState object I could use to call from c++? Maybe I could do something with that. The c++ code could

Re: [Numpy-discussion] Adopt Mersenne Twister 64bit?

2013-03-13 Thread Neal Becker
Neal Becker wrote: Neal Becker wrote: I guess I talked to you about 100 years ago about sharing state between numpy rng and code I have in c++ that wraps boost::random. So is there a C-api for this RandomState object I could use to call from c++? Maybe I could do something

[Numpy-discussion] can't run cython on mtrand.pyx

2013-03-13 Thread Neal Becker
Grabbed numpy-1.7.0 source. Cython is 0.18 cython mtrand.pyx produces lots of errors. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] can't run cython on mtrand.pyx

2013-03-13 Thread Neal Becker
Robert Kern wrote: On Wed, Mar 13, 2013 at 6:40 PM, Neal Becker ndbeck...@gmail.com wrote: Grabbed numpy-1.7.0 source. Cython is 0.18 cython mtrand.pyx produces lots of errors. It helps to copy-and-paste the errors that you are seeing. In any case, Cython 0.18 works okay on master's

Re: [Numpy-discussion] Adopt Mersenne Twister 64bit?

2013-03-14 Thread Neal Becker
Robert Kern wrote: On Wed, Mar 13, 2013 at 12:16 AM, Neal Becker ndbeck...@gmail.com wrote: I guess I talked to you about 100 years ago about sharing state between numpy rng and code I have in c++ that wraps boost::random. So is there a C-api for this RandomState object I could use to call

Re: [Numpy-discussion] Adopt Mersenne Twister 64bit?

2013-03-14 Thread Neal Becker
Robert Kern wrote: On Wed, Mar 13, 2013 at 12:16 AM, Neal Becker ndbeck...@gmail.com wrote: I guess I talked to you about 100 years ago about sharing state between numpy rng and code I have in c++ that wraps boost::random. So is there a C-api for this RandomState object I could use to call

Re: [Numpy-discussion] Adopt Mersenne Twister 64bit?

2013-03-14 Thread Neal Becker
Robert Kern wrote: On Thu, Mar 14, 2013 at 11:00 AM, Neal Becker ndbeck...@gmail.com wrote: Robert Kern wrote: On Wed, Mar 13, 2013 at 12:16 AM, Neal Becker ndbeck...@gmail.com wrote: I guess I talked to you about 100 years ago about sharing state between numpy rng and code I have in c

[Numpy-discussion] howto apply-along-axis?

2013-03-22 Thread Neal Becker
I frequently find I have my 1d function that performs some reduction that I'd like to apply-along some axis of an n-d array. As a trivial example, def sum(u): return np.sum (u) In this case the function is probably C/C++ code, but that is irrelevant (I think). Is there a reasonably

Re: [Numpy-discussion] picking elements with boolean masks

2013-03-25 Thread Neal Becker
Neal Becker wrote: starting with a NxM array, I want to select elements of the array using a set of boolean masks. The masks are simply where the indexes have a 0 or 1 in the corresponding bit position. For example, consider the case where M = 4. all_syms = np.arange (4) all_bits

[Numpy-discussion] howto reduce along arbitrary axis

2013-03-26 Thread Neal Becker
In the following code, the function maxstar is applied along the last axis. Can anyone suggest how to modify this to apply reduction along a user-specified axis? def maxstar2 (a, b): return max (a, b) + log1p (exp (-abs (a - b))) def maxstar (u): s = u.shape[-1] if s == 1:

[Numpy-discussion] what do I get if I build with MKL?

2013-04-19 Thread Neal Becker
What sorts of functions take advantage of MKL? Linear Algebra (equation solving)? Something like dot product? exp, log, trig of matrix? basic numpy arithmetic? (add matrixes) ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] what do I get if I build with MKL?

2013-04-19 Thread Neal Becker
KACVINSKY Tom wrote: You also get highly optimized BLAS routines, like dgemm and degemv. And does numpy/scipy just then automatically use them? When I do a matrix multiply, for example? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

[Numpy-discussion] 0-dim arrays inconsistency

2013-05-10 Thread Neal Becker
np.array ((0,0)) Out[10]: array([0, 0]) ok, it's 2 dimensional In [11]: np.array ((0,0)).shape Out[11]: (2,) except, it isn't ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] 0-dim arrays inconsistency

2013-05-10 Thread Neal Becker
Neal Becker wrote: np.array ((0,0)) Out[10]: array([0, 0]) ok, it's 2 dimensional In [11]: np.array ((0,0)).shape Out[11]: (2,) except, it isn't Sorry for the stupid question - please ignore ___ NumPy-Discussion mailing list NumPy-Discussion

[Numpy-discussion] somewhat less stupid problem with 0-d arrays

2013-05-10 Thread Neal Becker
It would be convenient if in arithmetic 0-d arrays were just ignored - it would seem to me to be convenient in generic code where a degenerate array is treated as nothing np.zeros ((0,0)) + np.ones ((2,2)) --- ValueError

Re: [Numpy-discussion] somewhat less stupid problem with 0-d arrays

2013-05-11 Thread Neal Becker
Sebastian Berg wrote: On Fri, 2013-05-10 at 19:57 -0400, Neal Becker wrote: It would be convenient if in arithmetic 0-d arrays were just ignored - it would seem to me to be convenient in generic code where a degenerate array is treated as nothing Small naming detail. A 0-d array

Re: [Numpy-discussion] RuntimeWarning: divide by zero encountered in log

2013-05-17 Thread Neal Becker
Nathaniel Smith wrote: On 16 May 2013 19:48, Jonathan Helmus jjhel...@gmail.com wrote: On 05/16/2013 01:42 PM, Neal Becker wrote: Is there a way to get a traceback instead of just printing the line that triggered the error? ___ NumPy

[Numpy-discussion] another indexing question

2013-05-20 Thread Neal Becker
I have a system that transmits signals for an alphabet of M symbols over and additive Gaussian noise channel. The receiver has a 1-d array of complex received values. I'd like to find the means of the received values according to the symbol that was transmitted. So transmit symbol indexes might

[Numpy-discussion] forwarded article (embracing tensors)

2013-05-30 Thread Neal Becker
I thought the topic of this article might be of interest here: https://groups.google.com/forum/?fromgroups#!topic/julia-dev/GAdcYzmibyo ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] lots of warnings with python3

2013-08-28 Thread Neal Becker
I tried running python2 -3 on some code, and found numpy produces a lot of warnings. Many like: python -3 -c 'import numpy' ... /usr/lib64/python2.7/site-packages/numpy/lib/polynomial.py:928: DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__ in 3.x But also:

Re: [Numpy-discussion] ANN: Scipy 0.13.0 beta 1 release

2013-09-04 Thread Neal Becker
Failed building on fedora 19 x86_64 using atlas: creating build/temp.linux-x86_64-2.7/numpy/linalg creating build/temp.linux-x86_64-2.7/numpy/linalg/lapack_lite compile options: '-DATLAS_INFO=\3.8.4\ -I/usr/include -Inumpy/core/include - Ibuild/src.linux-x86_64-2.7/numpy/core/include/numpy

Re: [Numpy-discussion] ANN: Numpy 1.8.0 beta 1 release

2013-09-04 Thread Neal Becker
Built on fedora linux 19 x86_64 using mkl: build OK using: env ATLAS=/usr/lib64 FFTW=/usr/lib64 BLAS=/usr/lib64 LAPACK=/usr/lib64 CFLAGS=-mtune=native -march=native -O3 LDFLAGS=-Wl,- rpath=/opt/intel/mkl/lib/intel64 python setup.py build and attached site.cfg:

Re: [Numpy-discussion] ANN: Scipy 0.13.0 beta 1 release

2013-09-04 Thread Neal Becker
David Cournapeau wrote: On Wed, Sep 4, 2013 at 1:00 PM, Neal Becker ndbeck...@gmail.com wrote: Failed building on fedora 19 x86_64 using atlas: creating build/temp.linux-x86_64-2.7/numpy/linalg creating build/temp.linux-x86_64-2.7/numpy/linalg/lapack_lite compile options: '-DATLAS_INFO

[Numpy-discussion] numpy 1.8.0b1 mkl test_xerbla failure

2013-09-05 Thread Neal Becker
Just want to make sure this post had been noted: Neal Becker wrote: Built on fedora linux 19 x86_64 using mkl: build OK using: env ATLAS=/usr/lib64 FFTW=/usr/lib64 BLAS=/usr/lib64 LAPACK=/usr/lib64 CFLAGS=-mtune=native -march=native -O3 LDFLAGS=-Wl,- rpath=/opt/intel/mkl/lib/intel64

Re: [Numpy-discussion] numpy 1.8.0b1 mkl test_xerbla failure

2013-09-06 Thread Neal Becker
Charles R Harris wrote: On Thu, Sep 5, 2013 at 5:34 AM, Neal Becker ndbeck...@gmail.com wrote: Just want to make sure this post had been noted: Neal Becker wrote: Built on fedora linux 19 x86_64 using mkl: build OK using: env ATLAS=/usr/lib64 FFTW=/usr/lib64 BLAS=/usr/lib64 LAPACK

Re: [Numpy-discussion] ANN: 1.8.0b2 release.

2013-09-09 Thread Neal Becker
Charles R Harris wrote: Hi all, I'm happy to announce the second beta release of Numpy 1.8.0. This release should solve the Windows problems encountered in the first beta. Many thanks to Christolph Gohlke and Julian Taylor for their hard work in getting those issues settled. It would be

[Numpy-discussion] my code (python version)

2013-09-10 Thread Neal Becker
Here's code I use for basic 2d histogramimport numpy as np def nint (x): if x = 0: return int (x + 0.5) else: return int (x - 0.5) class histogram2d (object): def __init__ (self, min, max, delta, clip=True): self.min = min self.max = max

[Numpy-discussion] openblas?

2013-09-23 Thread Neal Becker
Does numpy/scipy support building with openblas for blas,lapack instead of atlas? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Valid algorithm for generating a 3D Wiener Process?

2013-09-25 Thread Neal Becker
David Goldsmith wrote: Is this a valid algorithm for generating a 3D Wiener process? (When I graph the results, they certainly look like potential Brownian motion tracks.) def Wiener3D(incr, N): r = incr*(R.randint(3, size=(N,))-1) r[0] = 0 r = r.cumsum() t =

[Numpy-discussion] is np vector a sequence?

2013-10-28 Thread Neal Becker
isinstance (np.zeros (10), collections.Sequence) Out[36]: False That's unfortunate. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] ANN: NumPy 1.8.0 release.

2013-10-31 Thread Neal Becker
Thanks for the release! I am having a hard time finding the build instructions. Could you please add this to the announcement? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] ANN: NumPy 1.8.0 release.

2013-10-31 Thread Neal Becker
Charles R Harris wrote: On Thu, Oct 31, 2013 at 6:58 AM, Neal Becker ndbeck...@gmail.com wrote: Thanks for the release! I am having a hard time finding the build instructions. Could you please add this to the announcement? What sort of build instructions are you looking for? Chuck

[Numpy-discussion] strange behavior of += with object array

2013-10-31 Thread Neal Becker
import numpy as np #from accumulator import stat2nd_double ## Just to make this really clear, I'm making a dummy ## class here that overloads += class stat2nd_double (object): def __iadd__ (self, x):

  1   2   3   4   5   >