Re: [Numpy-discussion] Scalar-ndarray arguments passed to not_equal

2010-02-11 Thread Robert Kern
On Thu, Feb 11, 2010 at 15:03, Friedrich Romstedt wrote: > Robert Kern: >> def numpy_ops(**ops): >>    old_ops = np.set_numeric_ops(**ops) >>    try: >>        yield >>    finally: >>        np.set_numeric_ops(**old_ops) >> >> >> wi

Re: [Numpy-discussion] Scalar-ndarray arguments passed to not_equal

2010-02-11 Thread Robert Kern
ement from contextlib import contextmanager import numpy as np @contextmanager def numpy_ops(**ops): old_ops = np.set_numeric_ops(**ops) try: yield finally: np.set_numeric_ops(**old_ops) with numpy_ops(multiply=...): print np.array([1, 2, 3]) * np.array([1, 2, 3]) -- Robert K

Re: [Numpy-discussion] Determine if two arrays share references

2010-02-10 Thread Robert Kern
d b are computed. If they overlap then this function returns True. Otherwise, it returns False. A return of True does not necessarily mean that the two arrays share any element. It just means that they *might*. One example where this function returns True when a 100% accurate functi

Re: [Numpy-discussion] lib.recfunctions: which version? (was Re: Emulate left outer join?)

2010-02-10 Thread Robert Kern
On Wed, Feb 10, 2010 at 15:57, David Carmean wrote: > On Tue, Feb 09, 2010 at 04:49:30PM -0600, John Hunter wrote: >> 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.

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

2010-02-09 Thread Robert Kern
On Tue, Feb 9, 2010 at 18:02, wrote: > On Tue, Feb 9, 2010 at 6:52 PM, Robert Kern wrote: >> On Tue, Feb 9, 2010 at 17:47, Ralf Gommers >> wrote: >>> >>> >>> On Wed, Feb 10, 2010 at 6:02 AM, Robert Kern wrote: >>>> >>>> >&

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

2010-02-09 Thread Robert Kern
On Tue, Feb 9, 2010 at 17:47, Ralf Gommers wrote: > > > On Wed, Feb 10, 2010 at 6:02 AM, Robert Kern wrote: >> >> >> For some reason, numpy.lib.recfunctions isn't in the documentation >> editor. I'm not sure why. >> > Because it's not in

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

2010-02-09 Thread Robert Kern
ormed by dropping the fields not in the key for the two arrays and concatenating the result. This array is then sorted, and the common entries selected. The output is constructed by filling the fields with the selected entries. Matching is not preserved if there are some dupli

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-08 Thread Robert Kern
On Mon, Feb 8, 2010 at 21:27, Darren Dale wrote: > On Mon, Feb 8, 2010 at 10:24 PM, Robert Kern wrote: >> On Mon, Feb 8, 2010 at 21:23, Darren Dale wrote: >>> On Mon, Feb 8, 2010 at 10:10 PM, Robert Kern wrote: >>>> On Mon, Feb 8, 2010 at 20:50, Darren Dale wrote

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-08 Thread Robert Kern
On Mon, Feb 8, 2010 at 21:23, Darren Dale wrote: > On Mon, Feb 8, 2010 at 10:10 PM, Robert Kern wrote: >> On Mon, Feb 8, 2010 at 20:50, Darren Dale wrote: >>> On Mon, Feb 8, 2010 at 7:52 PM, Robert Kern wrote: >>>> On Mon, Feb 8, 2010 at 18:43, Darren Dale wrote

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-08 Thread Robert Kern
taining shared ownership and responsibility isn't majority rule, but consensus among implementors. We just don't have that right now, but we need to get stuff done anyways. -- Robert Kern "I have come to believe that the whole world i

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-08 Thread Robert Kern
On Mon, Feb 8, 2010 at 20:50, Darren Dale wrote: > On Mon, Feb 8, 2010 at 7:52 PM, Robert Kern wrote: >> On Mon, Feb 8, 2010 at 18:43, Darren Dale wrote: >>> On Mon, Feb 8, 2010 at 7:25 PM, Robert Kern wrote: >>>> Here's the problem that I don'

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-08 Thread Robert Kern
On Mon, Feb 8, 2010 at 18:43, Darren Dale wrote: > On Mon, Feb 8, 2010 at 7:25 PM, Robert Kern wrote: >> Here's the problem that I don't think many people appreciate: logical >> arguments suck just as much as personal experience in answering these >> questions. Yo

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-08 Thread Robert Kern
in the face, but without real data to premise them on, they are no better than the gut feelings. They can often be significantly worse if the strength of the logic gets confused with the strength of the premise. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless eni

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-08 Thread Robert Kern
ate to address deficiencies in the breadth and depth of the already-too-extensive discussion. You should have spoken up sooner. We need to make a decision now. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrib

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-08 Thread Robert Kern
g a final vote), we move on to a vote from the steering committee to formalize that majority. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-08 Thread Robert Kern
nsensus means everyone, not just a strong majority. http://producingoss.com/en/consensus-democracy.html -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-08 Thread Robert Kern
On Mon, Feb 8, 2010 at 16:10, Matthew Brett wrote: > On Mon, Feb 8, 2010 at 2:07 PM, Robert Kern wrote: >> On Mon, Feb 8, 2010 at 16:05, Darren Dale wrote: >>> On Mon, Feb 8, 2010 at 5:05 PM, Jarrod Millman wrote: >>>> On Mon, Feb 8, 2010 at 1:57 PM, Charles R Ha

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-08 Thread Robert Kern
1.5.0 >>> b) 2.0.0 >> >> My vote goes to b. > > You don't matter. Nor do I. Jarrod is on the steering committee. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad

Re: [Numpy-discussion] How long does it take to create an array?

2010-02-05 Thread Robert Kern
2,), (3,), (4,)] >>> >>> timeit np.array(x).reshape(-1)  # <-- slow > 1000 loops, best of 3: 832 us per loop >>> timeit np.array([z[0] for z in x]) > 1 loops, best of 3: 106 us per loop  # <-- fast When array() gets a sequence of sequences, it has to do more wo

Re: [Numpy-discussion] Efficiently converting numpy record array to a list of dictionary

2010-02-04 Thread Robert Kern
7;age', 'weight') In [7]: names = r.dtype.names In [8]: [dict(zip(names, record)) for record in r] Out[8]: [{'age': 31, 'name': 'Bill', 'weight': 260.0}, {'age': 15, 'name': 'Fre

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Robert Kern
anges in minor releases * There will be no API changes in bugfix releases """ -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth."

Re: [Numpy-discussion] Determine if numpy is installed from an extension

2010-02-03 Thread Robert Kern
/* Clear the error state since we are handling the error. */ PyErr_Clear(); /* ... set up for the sans-numpy case. */ } else { Py_DECREF(mod); import_array(); /* ... set up for the with-numpy case. */ } -- Robert Kern "I have come to believe that the whole world is

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-02 Thread Robert Kern
> things makes numpy 1.4.x backward compatible, at least as far as scipy > is concerned. So it seems the PyArray_Funcs change is the only > ABI-incompatible change. Except for the Cython bit. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigm

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-02 Thread Robert Kern
On Tue, Feb 2, 2010 at 21:08, David Cournapeau wrote: > Robert Kern wrote: >> On Tue, Feb 2, 2010 at 20:23, Neil Martinsen-Burrell >> wrote: >>This is useful feature for more than just datetime >> support and should be complete and useful at this time. > > Could

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-02 Thread Robert Kern
, we implemented it by adding a general feature to dtype objects such that they can hold arbitrary metadata. This is useful feature for more than just datetime support and should be complete and useful at this time. -- Robert Kern "I have come to believe that the whole world is an enigma, a h

Re: [Numpy-discussion] Distutils issue? [migrated]

2010-01-29 Thread Robert Kern
ched debug output; I wasn't > able to make a lot of sense out of it. At over 2400 lines, it's a bit > lengthy. Don't use CFLAGS. Please show the dump without that flag. Also, please show me the command line(s) that you are using to try to install numpy. -- Robert Kern "

Re: [Numpy-discussion] dtype and logical_and

2010-01-28 Thread Robert Kern
On Thu, Jan 28, 2010 at 10:31, Keith Goodman wrote: > I noticed that & (logical and) does support float dtype: & is not logical_and(). It is bitwise_and(). -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our

Re: [Numpy-discussion] strange divergence in performance

2010-01-20 Thread Robert Kern
xhibits the difference. In [28]: x = np.random.random_integers(0,10,size=5000) In [29]: %timeit m = x > 0 10 loops, best of 3: 19.1 us per loop In [30]: %timeit m = x > 1 10 loops, best of 3: 19.3 us per loop The difference is in the array[mask]. There are necessarily fewer True

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

2010-01-19 Thread Robert Kern
uaranteed? In a quick test, it seems to work. In any case, I suspect that needing to do both x and y will make doing the QR once and some two pairs of dot products a better proposition than two QR decompositons. -- Robert Kern "I have come to believe that the whole world is an enigma, a h

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

2010-01-19 Thread Robert Kern
On Tue, Jan 19, 2010 at 15:12, Gael Varoquaux wrote: > On Tue, Jan 19, 2010 at 02:58:32PM -0600, Robert Kern wrote: >> > I am not sure that what I am doing is optimal. > >> If confounds is orthonormal, then there is no need to use lstsq(). > >>   y = y - np.dot(n

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

2010-01-19 Thread Robert Kern
On Tue, Jan 19, 2010 at 14:47, Gael Varoquaux wrote: > On Tue, Jan 19, 2010 at 02:22:30PM -0600, Robert Kern wrote: >> > y = y - np.dot(confounds.T, linalg.lstsq(confounds.T, y)[0]) > >> > with np = numpy and linalg = scipy.linalg where scipy calls ATLAS. > >> For

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

2010-01-19 Thread Robert Kern
ors that are perpendicular to the space spanned by the 10 orthonormal vectors in confounds? > Most of the time is spent in linalg.lstsq. The length of the vectors is > 810, and there are about 10 confounds. Exactly what are the shapes? y.shape = (810, N); confounds.shape = (810, 10)? -- Robe

Re: [Numpy-discussion] how to do a proper 2 column sort on a 2 dimensional array ??

2010-01-19 Thread Robert Kern
ond column comes first. You can think of the procedure as "sort by the second column, now sort by the first column; where there are ties in the first column, the order is left alone from the previous sort on the second column". -- Robert Kern "I have come to believe that the

Re: [Numpy-discussion] Is this expected behavior?

2010-01-18 Thread Robert Kern
would create a weird special case in the semantics, and slow down common assignments that don't have the issue. It would be nice to have a fast in-place roll(), though this is not how one should implement it. -- Robert Kern "I have come to believe that the whole world is an enigma, a harm

Re: [Numpy-discussion] Is this expected behavior?

2010-01-18 Thread Robert Kern
lways one step behind the LHS pointer, thus it always reads the data that just got modified in the previous step. The data you expected it to read has already been wiped out. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made

Re: [Numpy-discussion] performance matrix multiplication vs. matlab

2010-01-18 Thread Robert Kern
posed as being used, no, it is not the key point. We will not incorporate Eigen2 code into numpy, particularly not as the default linear algebra implementation, because we wish to keep numpy's source as being only BSD. This is a policy decision of the numpy team, not a legal incompatibility.

Re: [Numpy-discussion] performance matrix multiplication vs. matlab

2010-01-18 Thread Robert Kern
On Mon, Jan 18, 2010 at 10:26, Benoit Jacob wrote: > 2010/1/18 Robert Kern : >> On Mon, Jan 18, 2010 at 09:35, Benoit Jacob wrote: >> >>> Sorry for continuing the licensing noise on your list --- I though >>> that now that I've started, I should let you kno

Re: [Numpy-discussion] performance matrix multiplication vs. matlab

2010-01-18 Thread Robert Kern
oprietary license even if I allow them to do that with the application as a whole. For us to use Eigen2 in numpy such that our users could use, modify and redistribute numpy+Eigen2, in its entirety, under the terms of the BSD license, we would have to get permission from you to distribute Eigen2 under

Re: [Numpy-discussion] performance matrix multiplication vs. matlab

2010-01-17 Thread Robert Kern
On Sun, Jan 17, 2010 at 13:18, Benoit Jacob wrote: > 2010/1/17 Robert Kern : >> On Sun, Jan 17, 2010 at 12:11, Benoit Jacob wrote: >>> 2010/1/17 Robert Kern : >>>> On Sun, Jan 17, 2010 at 08:52, Benoit Jacob >>>> wrote: >>>>> 2010/1/1

Re: [Numpy-discussion] performance matrix multiplication vs. matlab

2010-01-17 Thread Robert Kern
On Sun, Jan 17, 2010 at 12:11, Benoit Jacob wrote: > 2010/1/17 Robert Kern : >> On Sun, Jan 17, 2010 at 08:52, Benoit Jacob wrote: >>> 2010/1/17 David Cournapeau : >> >>>> There are several issues with eigen2 for NumPy usage: >>>>  - using it as a

Re: [Numpy-discussion] performance matrix multiplication vs. matlab

2010-01-17 Thread Robert Kern
d the BSD license that we, as a matter of policy, do not wish to impose on numpy users. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." --

Re: [Numpy-discussion] Percentiles and Box Plots

2010-01-15 Thread Robert Kern
the Box Plot quartiles, and ranges. I think that's the > simplest set for Box plots. I don't need to draw anything. Use scipy.stats.scoreatpercentile() -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own

Re: [Numpy-discussion] Wanted: new release manager for 1.5 and above

2010-01-15 Thread Robert Kern
On Fri, Jan 15, 2010 at 08:46, Ralf Gommers wrote: > Is it necessary to have OS X to build the dmg installer, or could you build > that from linux with some modifications to the build script? No, you need OS X to build and package the OS X binaries. -- Robert Kern "I have come

Re: [Numpy-discussion] dtype.isbuiltin changed by .newbyteorder

2010-01-14 Thread Robert Kern
Using .newbyteorder() to swap the byte order to the non-native byte order should and does cause the resulting dtype to not be considered builtin. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is mad

Re: [Numpy-discussion] wrong casting of augmented assignment statements

2010-01-12 Thread Robert Kern
On Tue, Jan 12, 2010 at 12:31, Sebastian Walter wrote: > On Tue, Jan 12, 2010 at 7:09 PM, Robert Kern wrote: >> On Tue, Jan 12, 2010 at 12:05, Sebastian Walter >> wrote: >>> Hello, >>> I have a question about the augmented assignment statements *=, +=, etc. >

Re: [Numpy-discussion] wrong casting of augmented assignment statements

2010-01-12 Thread Robert Kern
py arrays in-place, so the usual casting rules for assignment into an array apply. Namely, the array being assigned into keeps its dtype. If you do not want in-place modification, do not use augmented assignment. -- Robert Kern "I have come to believe that the whole world is an enigma, a har

Re: [Numpy-discussion] numpy1.4 dtype issues: scipy.stats & pytables

2010-01-12 Thread Robert Kern
gs ? > (Whisper, how'd it get past testing ?) It's not a bug, but it is a known issue. We tried very hard to keep numpy 1.4 binary compatible; however, Pyrex and Cython impose additional runtime checks above and beyond binary compatibility. -- Robert Kern "I have come to believ

Re: [Numpy-discussion] TypeError: 'module' object is not callable

2010-01-11 Thread Robert Kern
On Mon, Jan 11, 2010 at 18:03, Jankins wrote: > It is very simple code: > > import networkx as nx > import scipy.sparse.linalg as linalg > > G = nx.Graph() > G.add_star(range(9)) > M= nx.to_scipy_sparse_matrix(G) > print linalg.eigen(M) > > Thanks. Please post th

Re: [Numpy-discussion] TypeError: 'module' object is not callable

2010-01-11 Thread Robert Kern
as "__call__" method. Why couldn't I call > scipy.sparse.linalg.eigen(...)? Please show the complete code and the complete traceback. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to inte

Re: [Numpy-discussion] performance matrix multiplication vs. matlab

2010-01-08 Thread Robert Kern
implementation for numpy when their is no blas installed. I think > the license would allow to include it in numpy directly. It is licensed under the LGPLv3, so it is not compatible with the numpy license. -- Robert Kern "I have come to believe that the whole world is an enigma, a ha

Re: [Numpy-discussion] 1.4.0 installer fails on OSX 10.6.2

2010-01-07 Thread Robert Kern
ts. > > I'd forgotten about that. It's not really true, though. MacPorts took /opt/local/, but /opt// probably hasn't been. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to

Re: [Numpy-discussion] cPickle/unPickle across archs

2010-01-07 Thread Robert Kern
ot;: x = Numeric.array(thestr,"O") else: x = Numeric.fromstring(thestr, typecode) x.shape = shape if LittleEndian != Endian: return x.byteswapped() else: return x Numeric.array_constructor = patched_array_constructor After you have done that, cPi

Re: [Numpy-discussion] [matplotlib-devel] Announcing toydist, improving distribution and packaging situation

2010-01-03 Thread Robert Kern
#x27;s not quite the same. That is the R equivalent of Python's recent per-user site-packages feature (every user get's their own sandbox), not virtualenv (every project gets it's own sandbox). The former feature has a long history in the multiuser UNIX world and is not really contro

Re: [Numpy-discussion] is it safe to change the dtype without rebuilding the array?

2010-01-01 Thread Robert Kern
ype([('a','l'),('b','l'),('c','l')]) > > In [254]: y.dtype=dt > > Is it okay? > The problem is that it's not easy to rebuild the array. > I tried with: > > y.astype(dt) > np.array(y, dt) > np.array(y.tolist

Re: [Numpy-discussion] Announcing toydist, improving distribution and packaging situation

2009-12-30 Thread Robert Kern
On Wed, Dec 30, 2009 at 13:10, René Dudfield wrote: > On Wed, Dec 30, 2009 at 7:08 PM, Robert Kern wrote: >> On Wed, Dec 30, 2009 at 12:47, René Dudfield wrote: >>> 500+ packages on pypi.   Provide a counter point, otherwise the >>> evidence is against you

Re: [Numpy-discussion] Announcing toydist, improving distribution and packaging situation

2009-12-30 Thread Robert Kern
ver farms, not interactive experimenters. > > 500+ packages on pypi.   Provide a counter point, otherwise the > evidence is against your position - overwhelmingly. Linux distributions, which are much, much more popular than any collection of packages on PyPI you might care to name. Isolated envir

Re: [Numpy-discussion] [ANN] numpy 1.4.0 rc2

2009-12-28 Thread Robert Kern
modules in scipy, but shouldn't have affected anything in matplotlib. The traceback may help us identify the issue you are seeing. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though

Re: [Numpy-discussion] cos -- NameError: global name 'cos' is not defined

2009-12-21 Thread Robert Kern
s forced to use math.cos(). > Why one but not the other? Presumably you have imported it somewhere. Please show your program, and we may be able to point it out to you. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by

Re: [Numpy-discussion] cos -- NameError: global name 'cos' is not defined

2009-12-21 Thread Robert Kern
e in the math module. You want math.cos(). The same goes for radians() and acos() and sin(). -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." --

Re: [Numpy-discussion] help(numpy.dot) Hmmm.

2009-12-20 Thread Robert Kern
On Sun, Dec 20, 2009 at 22:44, Wayne Watson wrote: > 1.2.0. Did you find the description in the reference manual? No, he found it using help(numpy.dot) using a more recent version of numpy. I highly recommend upgrading. -- Robert Kern "I have come to believe that the whole world is a

Re: [Numpy-discussion] Proposal for matrix_rank function in numpy

2009-12-18 Thread Robert Kern
ticular files under test/ that just contain doctests); they're a handy way to write certain tests although they have well known and annoying limits for numerical work. I just don't want documentation examples to be doctests. -- Robert Kern "I have come to believe tha

Re: [Numpy-discussion] Segmentation fault with argsort

2009-12-18 Thread Robert Kern
On Fri, Dec 18, 2009 at 11:57, Skipper Seabold wrote: > On Fri, Dec 18, 2009 at 12:52 PM, Robert Kern wrote: >> On Fri, Dec 18, 2009 at 11:46, Keith Goodman wrote: >>> I am using the numpy 1.3 binary from Ubuntu 9.10. Is this already >>> known, fixed, reproduci

Re: [Numpy-discussion] Segmentation fault with argsort

2009-12-18 Thread Robert Kern
#x27;np.int64' object has no attribute 'argsort' Why would you expect that? On OS X with an SVN checkout ~1.4: In [1]: np.array(121).argsort(0).argsort(0) Out[1]: 0 In [6]: np.int64.argsort Out[6]: -- Robert Kern "I have come to believe that the whole world is an enigma, a ha

Re: [Numpy-discussion] np.void from 0d array + subclassing

2009-12-17 Thread Robert Kern
On Thu, Dec 17, 2009 at 17:41, Pierre GM wrote: > On Dec 17, 2009, at 6:35 PM, Robert Kern wrote: >> On Thu, Dec 17, 2009 at 16:11, Pierre GM wrote: >>> Here's the catch: IIUC, each individual element of a nD structured array is >>> a void, provided the element

Re: [Numpy-discussion] np.void from 0d array + subclassing

2009-12-17 Thread Robert Kern
Here's the catch: IIUC, each individual element of a nD structured array is a > void, provided the element can be accessed, ie that n>0. A 0D array cannot be > indexed, so I don't know how capture the object below. The sad trick I found > was to do a .reshape(1)[0], but that l

Re: [Numpy-discussion] Proposal for matrix_rank function in numpy

2009-12-15 Thread Robert Kern
uld be appropriate: .. [1] G. H. Golub and C. F. Van Loan, _Matrix Computations_. Baltimore: Johns Hopkins University Press, 1996. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to inter

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

2009-12-14 Thread Robert Kern
cial %y In [2]: %timeit numpy.i0(1.0) 1000 loops, best of 3: 921 µs per loop In [3]: %timeit special.i0(1.0) 10 loops, best of 3: 5.6 µs per loop -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our

Re: [Numpy-discussion] Import error in builds of 7726

2009-12-12 Thread Robert Kern
: _npy_cexp Referenced from: /Library/Python/2.6/site-packages/ numpy-1.4.0.dev7726-py2.6-macosx-10.6-universal.egg/ numpy/core/umath.so Expected in: flat namespace in /Library/Python/2.6/site-packages/ numpy-1.4.0.dev7726-py2.6-macosx-10.6-universal.egg /numpy/core/umath.so -- Robert Kern "

Re: [Numpy-discussion] nan_to_num and bool arrays

2009-12-11 Thread Robert Kern
t;    y = x.copy() >    old_shape = y.shape >    if y.shape == (): >       # We need element access. >       y.shape = (1,) >    t = y.dtype.type >    if issubclass(t, _nx.complexfloating): >        return nan_to_num(y.real) + 1j * nan_to_num(y.imag) Almost! You need to handle the sh

Re: [Numpy-discussion] nan_to_num and bool arrays

2009-12-11 Thread Robert Kern
gt;   array([ Inf]) Right. This is the problem I was referring to: "I think that sequences should be coerced to arrays for output and this check should be more explicit about what it handles. [1.0] will have a problem if you don't." -- Robert Kern "I have come to believe that t

Re: [Numpy-discussion] nan_to_num and bool arrays

2009-12-11 Thread Robert Kern
On Fri, Dec 11, 2009 at 17:44, Keith Goodman wrote: > On Fri, Dec 11, 2009 at 2:22 PM, Robert Kern wrote: >> On Fri, Dec 11, 2009 at 16:09, Keith Goodman wrote: >>> On Fri, Dec 11, 2009 at 1:14 PM, Robert Kern wrote: >>>> On Fri, Dec 11, 2009 at 14:41, Keith Goo

Re: [Numpy-discussion] nan_to_num and bool arrays

2009-12-11 Thread Robert Kern
On Fri, Dec 11, 2009 at 16:09, Keith Goodman wrote: > On Fri, Dec 11, 2009 at 1:14 PM, Robert Kern wrote: >> On Fri, Dec 11, 2009 at 14:41, Keith Goodman wrote: >>> On Fri, Dec 11, 2009 at 12:08 PM, Bruce Southey wrote: >> >>>> So I agree that it should

Re: [Numpy-discussion] nan_to_num and bool arrays

2009-12-11 Thread Robert Kern
nan float objects in object arrays and float columns in structured arrays, but the current code does not handle either of those anyways. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as th

Re: [Numpy-discussion] nan_to_num and bool arrays

2009-12-11 Thread Robert Kern
>> bool(np.NINF) > True >  >>> bool(np.NaN) > True >  >>> bool(np.PZERO) > False >  >>> bool(np.NZERO) > False No, that's the other way around, converting floats to bools. Converting bools to floats is trivial: True->1.0, False->0.

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

2009-12-10 Thread Robert Kern
y >> and prevent people from wasting days. (Hopefully, we can avoid wasting >> days discussing this issue too :-) ). > > Yes. We can even make it a PendingDeprecationWarning, when we become > convinced that this feature should go away in entirety. PendingDeprecationWarnings are o

Re: [Numpy-discussion] [Nipy-devel] Impossibility to build nipy on recent numpy?

2009-12-10 Thread Robert Kern
need to bug report to ubuntu. Anybody feels like doing it, or > do I need to go ahead :). It's your problem. :-) -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had

Re: [Numpy-discussion] Impossibility to build nipy on recent numpy?

2009-12-09 Thread Robert Kern
.a > python setup.py build_ext --inplace If you are building numpy inplace, you will also have to delete the inplace headers. nuke: rm -rf build rm -f numpy/core/include/numpy/__multiarray_api.c numpy/core/include/numpy/__multiarray_api.h numpy/core/include/numpy/__ufunc_api.c num

Re: [Numpy-discussion] Impossibility to build nipy on recent numpy?

2009-12-09 Thread Robert Kern
the case, I think that it means that we need to all use the > same version of numpy (1.3). > > Does anybody know if the cython folks are going to work around that > anytime soon (I am not on the cython mailing list, so I am not asking > there)? Yes. -- Robert Kern "I have come to

Re: [Numpy-discussion] numpy distutils breaks scipy install on mac

2009-12-09 Thread Robert Kern
On Wed, Dec 9, 2009 at 14:03, Mark Sienkiewicz wrote: > Robert Kern wrote: >> On Tue, Dec 8, 2009 at 15:36, Mark Sienkiewicz wrote: >> >>> >>> ( Presumably, some other version of gfortan does accept -arch, or this >>> code wouldn't be here, right?

Re: [Numpy-discussion] Release blockers for 1.4.0 ?

2009-12-09 Thread Robert Kern
On Wed, Dec 9, 2009 at 01:41, Anne Archibald wrote: > 2009/12/8 Robert Kern : >>  olderr = np.seterr(divide='ignore', invalid='ignore') >>  try: >>    result = self.f(da, db, *args, **kwargs) >>  finally: >>    np.seterr(**olderr) > >

Re: [Numpy-discussion] Can't set an element of a subset of an array, , ,

2009-12-08 Thread Robert Kern
['horizon']==i][2] assigns to the copy, which then gets thrown away. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco

Re: [Numpy-discussion] What protocol to use now?

2009-12-08 Thread Robert Kern
re. > However, future versions of numpy will target PEP 3118 – The Revised > Buffer Protocol. PEP 3118 was incorporated into Python 2.6 and 3.0, and > we hope to incorporate it into numpy 1.5 > ... > > """ The Cython information is still nice. Also, it should not be a

Re: [Numpy-discussion] What protocol to use now?

2009-12-08 Thread Robert Kern
On Tue, Dec 8, 2009 at 15:44, Christopher Barker wrote: > Robert Kern wrote: >>> The array interface was made for this sort of thing, but is deprecated: >>> >>> http://docs.scipy.org/doc/numpy/reference/arrays.interface.html > >> I think the wording

Re: [Numpy-discussion] numpy distutils breaks scipy install on mac

2009-12-08 Thread Robert Kern
r this > code wouldn't be here, right? ) Right. The -arch flag was added by Apple to GCC and their patch really should be applied to all builds of GCC compilers for the Mac. It is deeply disappointing that Fink ignored this. The only Mac gfortran build that I can recommend is here: http://

Re: [Numpy-discussion] Release blockers for 1.4.0 ?

2009-12-08 Thread Robert Kern
On Tue, Dec 8, 2009 at 15:25, Pierre GM wrote: > On Dec 8, 2009, at 12:54 PM, Robert Kern wrote: >> >> As far as I can tell, the faulty global seterr() has been in place >> since 1.1.0, so fixing it at all should be considered a feature >> change. It's not likely t

Re: [Numpy-discussion] Cython issues w/ 1.4.0

2009-12-08 Thread Robert Kern
On Tue, Dec 8, 2009 at 14:52, Dag Sverre Seljebotn wrote: > Robert Kern wrote: >> On Tue, Dec 8, 2009 at 12:38, Pauli Virtanen wrote: >>> - We need to cache the buffer protocol format string somewhere, >>>  if we do not want to regenerate it on each buffer acquisi

Re: [Numpy-discussion] What protocol to use now?

2009-12-08 Thread Robert Kern
I don't think that we actually decided to deprecate the interface. PEP 3118 is not yet implemented by numpy, and the PEP 3118 API won't be available to Python's <2.6 (Cython's workarounds notwithstanding). Pauli, did we discuss this before you wrote that warning and I'm

Re: [Numpy-discussion] Cython issues w/ 1.4.0

2009-12-08 Thread Robert Kern
On Tue, Dec 8, 2009 at 12:38, Pauli Virtanen wrote: > ti, 2009-12-08 kello 12:14 -0600, Robert Kern kirjoitti: >> On Tue, Dec 8, 2009 at 12:08, Pauli Virtanen wrote: >> > ke, 2009-12-09 kello 02:47 +0900, David Cournapeau kirjoitti: >> > [clip] >> >>

Re: [Numpy-discussion] Cython issues w/ 1.4.0

2009-12-08 Thread Robert Kern
is not cheap! > We should maybe convince the Cython people to disable this check, at > least for Numpy. They appear to be. See the latest messages in the thread "Checking extension type sizes". -- Robert Kern "I have come to believe that the whole world is an enigma, a

Re: [Numpy-discussion] Release blockers for 1.4.0 ?

2009-12-08 Thread Robert Kern
On Tue, Dec 8, 2009 at 11:41, David Cournapeau wrote: > On Wed, Dec 9, 2009 at 1:21 AM, Robert Kern wrote: > >> The default has always been "print", not "warn" (except for underflow, >> which was "ignore"). > > Ah, ok, that explains

Re: [Numpy-discussion] Cython issues w/ 1.4.0

2009-12-08 Thread Robert Kern
ArrayDescr -- and this breaks >> previously compiled Cython modules. > > It seems that it is partly a cython problem. It's *entirely* a Cython problem. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless

Re: [Numpy-discussion] Release blockers for 1.4.0 ?

2009-12-08 Thread Robert Kern
ow, which was "ignore"). However, "warn" is better for the reasons you state (except for underflow, which should remain "ignore"). -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enig

Re: [Numpy-discussion] re cfunctions help with concatenating (vstack, hstack, etc.)

2009-12-07 Thread Robert Kern
the correct length, but it is an > array of tuples and no longer a record array. Am I missing a step? It's still a structured array (albeit a masked one); however, it is no longer a recarray. recarray is just a convenience class that provide attribute access. Use C['datetime'] to a

Re: [Numpy-discussion] Some incompatibilities in numpy trunk

2009-12-06 Thread Robert Kern
at least turned into a >= check, but it got no traction. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco ___

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

2009-12-02 Thread Robert Kern
il the approach > advocated in: http://hdl.handle.net/1877/438 > is generally accepted. We are not changing the behavior of numpy.std() or numpy.var() at this point in time. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible

Re: [Numpy-discussion] ANN: qimage2ndarray - converting between QImages and numpy.ndarrays

2009-12-02 Thread Robert Kern
e in that application. Look at the file GPL_EXCEPTION.TXT . -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth.&quo

Re: [Numpy-discussion] make hstack and vstack promote 1-D argument to 2-D when necessary

2009-11-23 Thread Robert Kern
case, you might want to use column_stack() which explicitly treats 1D arrays like columns. Otherwise, just use column vectors explicitly. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as

Re: [Numpy-discussion] Applying argwhere to an array

2009-11-19 Thread Robert Kern
ators like +-/* and array broadcasting works on them, too. So, if d.shape == (N, 10), let's say, then you could do: np.argwhere(d > [1,1,1,1,1,2,2,2,2,2]) -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own

Re: [Numpy-discussion] matplotlib is breaking numpy

2009-11-19 Thread Robert Kern
aces internal to matplotlib, I don't know. With some care, you can use gc.get_referrers() to find the objects that are holding direct references to your memmap. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terri

Re: [Numpy-discussion] Solaris Sparc build broken

2009-11-19 Thread Robert Kern
On Thu, Nov 19, 2009 at 01:43, David Cournapeau wrote: > Robert Kern wrote: > >>  One can have a proprietary application statically linked >> with an LGPL library. The only detail there is that, in order to >> satisfy the "user must be able to relink the applicati

<    5   6   7   8   9   10   11   12   13   14   >