Re: [Numpy-discussion] Sorting objects with ndarrays

2010-02-28 Thread Pauli Virtanen
su, 2010-02-28 kello 10:25 +0100, Gael Varoquaux kirjoitti: [clip] The problem is that ndarrays cannot be compared. So I have tried to override the 'cmp' in the 'sorted' function, however I am comparing fairly complex objects, and I am having a hard time predicting wich member of the object

Re: [Numpy-discussion] setting decimal accuracy in array operations (scikits.timeseries)

2010-03-03 Thread Pauli Virtanen
is significantly more than what is printed. Most likely, your problem has a different cause. Are you sure Excel is using a high enough accuracy? If you want more help, it would be useful to post a self-contained code that demonstrates the error. -- Pauli Virtanen

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

2010-03-09 Thread Pauli Virtanen
slightly less than for Numpy. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] crash at prompt exit after running test

2010-03-09 Thread Pauli Virtanen
ti, 2010-03-09 kello 21:14 +0100, Johann Cohen-Tanugi kirjoitti: thinking about it, this morning there was a fedora update to python, so I am using 2.6.2-4.fc12. Looks like the problem is in python itself, hence this piece of info. That the problem would be in Python is not so clear to me.

Re: [Numpy-discussion] crash at prompt exit after running test

2010-03-09 Thread Pauli Virtanen
more fun : [co...@jarrett tests]$ pwd /home/cohen/sources/python/numpy/numpy/core/tests [co...@jarrett tests]$ python -c 'import test_ufunc' python: Modules/gcmodule.c:277: visit_decref: Assertion `gc-gc.gc_refs != 0' failed. Aborted (core dumped) What happens if you only import the

Re: [Numpy-discussion] crash at prompt exit after running test

2010-03-10 Thread Pauli Virtanen
Wed, 10 Mar 2010 10:28:07 +0100, Johann Cohen-Tanugi wrote: On 03/10/2010 01:55 AM, Pauli Virtanen wrote: more fun : [co...@jarrett tests]$ pwd /home/cohen/sources/python/numpy/numpy/core/tests [co...@jarrett tests]$ python -c 'import test_ufunc' python: Modules/gcmodule.c:277: visit_decref

Re: [Numpy-discussion] crash at prompt exit after running test

2010-03-10 Thread Pauli Virtanen
Wed, 10 Mar 2010 15:40:04 +0100, Johann Cohen-Tanugi wrote: Pauli, isn't it hopeless to follow the execution of the source code when the crash actually occurs when I exit, and not when I execute. I would have to understand enough of this umath_tests.c.src to spot a refcount error or things

Re: [Numpy-discussion] subclassing ndarray in python3

2010-03-11 Thread Pauli Virtanen
Hi Darren, to, 2010-03-11 kello 11:11 -0500, Darren Dale kirjoitti: Now that the trunk has some support for python3, I am working on making Quantities work with python3 as well. I'm running into some problems related to subclassing ndarray that can be illustrated with a simple script,

Re: [Numpy-discussion] problem with applying patch

2010-03-13 Thread Pauli Virtanen
Sat, 13 Mar 2010 12:06:24 -0700, z99719 z99719 wrote: [clip] The patch files are placed in the top level numpy sandbox directory and are in xml format rather than a diff file. I used save link as on the link to download the patch on the Attachments section of the link page. That gives you the

Re: [Numpy-discussion] integer division rule?

2010-03-13 Thread Pauli Virtanen
la, 2010-03-13 kello 15:32 -0500, Alan G Isaac kirjoitti: Francesc Altet once provided an example that for integer division, numpy uses the C99 rule: round towards 0. This is different than Python's rule for integer division: round towards negative infinity. But I cannot reproduce his

Re: [Numpy-discussion] [OT] Starving CPUs article featured in IEEE's ComputingNow portal

2010-03-20 Thread Pauli Virtanen
this probably depends a lot on the actual cache arrangement. But perhaps numexpr has such heuristics, and we could steal them? -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy

Re: [Numpy-discussion] Array bug with character (regression from 1.4.0)

2010-03-21 Thread Pauli Virtanen
path has been changed at all. One would have to follow the C execution path with gdb to find out what goes wrong. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Array bug with character (regression from 1.4.0)

2010-03-21 Thread Pauli Virtanen
su, 2010-03-21 kello 16:13 -0600, Charles R Harris kirjoitti: I was wondering if this was related to Michael's fixes for character arrays? A little bisection might help localize the problem. It's a bug I introduced in r8144... I forgot one *can* assign strings to 0-d arrays, and strings are

Re: [Numpy-discussion] [OT] Starving CPUs article featured in IEEE's ComputingNow portal

2010-03-22 Thread Pauli Virtanen
on. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] StringIO test failure with Python3.1.2

2010-03-24 Thread Pauli Virtanen
ke, 2010-03-24 kello 09:20 -0600, Charles R Harris kirjoitti: What would be the best fix? Should we rename io to something like npyio? That, or: Disable import conversions in tools/py3tool.py for that particular file, and fix any import errors manually so that the same code works both for

Re: [Numpy-discussion] StringIO test failure with Python3.1.2

2010-03-24 Thread Pauli Virtanen
ke, 2010-03-24 kello 10:28 -0500, Robert Kern kirjoitti: utils.py is the only file in there that imports StringIO. It should probably do a local import from io import BytesIO because io.py already contains some Python3-awareness: if sys.version_info[0] = 3: import io BytesIO =

Re: [Numpy-discussion] StringIO test failure with Python3.1.2

2010-03-24 Thread Pauli Virtanen
like another Python bug. All objects probably should have the __class__ attribute... -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] should ndarray implement __round__ for py3k?

2010-03-25 Thread Pauli Virtanen
arrays. Anyway, it could be nice to have. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Dealing with roundoff error

2010-03-28 Thread Pauli Virtanen
a terminating representation in base-2: 0.1_10 = 0.0001100110011001100110011.._2 -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Py3k: making a py3k compat header available in installed numpy for scipy

2010-03-29 Thread Pauli Virtanen
ma, 2010-03-29 kello 19:13 +0900, David Cournapeau kirjoitti: I have worked on porting scipy to py3k, and it is mostly working. One thing which would be useful is to install something similar to npy_3kcompat.h in numpy, so that every scipy extension could share the compat header. Is the

Re: [Numpy-discussion] Py3k: making a py3k compat header available in installed numpy for scipy

2010-03-30 Thread Pauli Virtanen
2010/3/30 David Cournapeau da...@silveregg.co.jp Pauli Virtanen wrote: [clip] At least, I don't see what I would like to change there. The only thing I wouldn't perhaps like to have in the long run are the PyString and possibly PyInt redefinition macros. I would also prefer a new name

Re: [Numpy-discussion] Making a 2to3 distutils command ?

2010-03-30 Thread Pauli Virtanen
2010/3/30 David Cournapeau da...@silveregg.co.jp: Currently, when building numpy with python 3, the 2to3 conversion happens before calling any distutils command. Was there a reason for doing it as it is done now ? This allowed 2to3 to also port the various setup*.py files and numpy.distutils,

Re: [Numpy-discussion] Making a 2to3 distutils command ?

2010-03-30 Thread Pauli Virtanen
ti, 2010-03-30 kello 07:18 -0600, Ryan May kirjoitti: Out of curiosity, is there something wrong with the support for 2to3 that already exists within distutils? (Other than it just being distutils) http://bruynooghe.blogspot.com/2010/03/using-lib2to3-in-setuppy.html That AFAIK converts only

[Numpy-discussion] Ufunc memory access optimizations (Was: ufuncs on funny strides ...)

2010-04-01 Thread Pauli Virtanen
the reduction: http://github.com/pv/numpy-work/tree/ticket/1143-speedup-reduce http://projects.scipy.org/numpy/ticket/1143 Not production quality so far, and the non-C-output order would definitely help also here.) -- Pauli Virtanen ___ NumPy-Discussion

Re: [Numpy-discussion] Proposal for new ufunc functionality

2010-04-10 Thread Pauli Virtanen
that should be though about is specifying the Python-side interface to generalized ufuncs. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Is this a small bug in numpydoc?

2010-04-14 Thread Pauli Virtanen
this without a second pair of eyes... Yeah, it's a bug, I think. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] My GSoC Proposal to Implement a Subset of NumPy for PyPy

2010-04-18 Thread Pauli Virtanen
of a proof-of-concept subset. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Disabling Extended Precision in NumPy (like -ffloat-store)

2010-04-21 Thread Pauli Virtanen
this is to recompile Numpy (and possibly, also Python) with the -ffloat-store option turned on. When compiling Numpy, you should be able to insert the flag via OPT=-ffloat-store python setup.py build -- Pauli Virtanen ___ NumPy-Discussion mailing

[Numpy-discussion] Adding an ndarray.dot method

2010-04-29 Thread Pauli Virtanen
Wed, 28 Apr 2010 14:12:07 -0400, Alan G Isaac wrote: [clip] Here is a related ticket that proposes a more explicit alternative: adding a ``dot`` method to ndarray. http://projects.scipy.org/numpy/ticket/1456 I kind of like this idea. Simple, obvious, and leads to clear code:

Re: [Numpy-discussion] Datetime overflow error, attn Stefan.

2010-05-09 Thread Pauli Virtanen
Sat, 08 May 2010 18:44:59 -0600, Charles R Harris wrote: [clip] Because window's longs are always 32 bit, I think this is a good indication that somewhere a long is being used instead of an intp. The test itself used 32-bit integers. Fix'd. Pauli

Re: [Numpy-discussion] pareto docstring

2010-05-11 Thread Pauli Virtanen
. A third option would be just to silently fix the bug. In any case the change should be mentioned noticeably in the release notes. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy

Re: [Numpy-discussion] savetxt not working with python3.1

2010-05-17 Thread Pauli Virtanen
Mon, 17 May 2010 13:22:18 -0400, Skipper Seabold wrote: [clip] What version of Numpy? Can you file a bug ticket with a failing example? I couldn't replicated with r8417 on Python 3. It was fixed in r8411. -- Pauli Virtanen ___ NumPy-Discussion

Re: [Numpy-discussion] dtype and array creation

2010-05-20 Thread Pauli Virtanen
something more sensible. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Build failure at rev8246

2010-05-21 Thread Pauli Virtanen
building from a clean checkout. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Extending documentation to c code

2010-05-25 Thread Pauli Virtanen
aimed doing that in Python exist, for instance http://code.google.com/p/pycparser/ -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Extending documentation to c code

2010-05-26 Thread Pauli Virtanen
, Anyway, we can probably nevertheless just agree on a readable plain-text/ rst format, and then just use doxygen to generate the docs, as a band-aid. http://github.com/pv/numpycdoc -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion

Re: [Numpy-discussion] Introduction to Scott, Jason, and (possibly) others from Enthought

2010-05-26 Thread Pauli Virtanen
for reuse and be more easy to maintain, but I think how and where they would be exposed hasn't been discussed so far... -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Reading and writing binary data to/from file objects

2010-05-26 Thread Pauli Virtanen
ke, 2010-05-26 kello 14:07 +0200, Christoph Bersch kirjoitti: f = open(fname2, 'w') [clip] Am I doing something substantially wrong or is this a bug? You are opening files in text mode. Use mode 'wb' instead. -- Pauli Virtanen ___ NumPy-Discussion

Re: [Numpy-discussion] Extending documentation to c code

2010-05-26 Thread Pauli Virtanen
Wed, 26 May 2010 07:15:08 -0600, Charles R Harris wrote: On Wed, May 26, 2010 at 2:59 AM, Pauli Virtanen p...@iki.fi wrote: Wed, 26 May 2010 06:57:27 +0900, David Cournapeau wrote: [clip: doxygen] It is yet another format to use inside C sources (I don't think doxygen supports rest

Re: [Numpy-discussion] NotImplemented returns

2010-05-27 Thread Pauli Virtanen
. The function should raise a ValueError instead. NotImplemented is meant only for use as a placeholder singleton in implementation of rich comparison operations etc., and we shouldn't introduce any new meanings IMHO. -- Pauli Virtanen ___ NumPy-Discussion

Re: [Numpy-discussion] Finding Star Images on a Photo (Video chip) Plate?

2010-05-29 Thread Pauli Virtanen
should be is http://docs.scipy.org/ http://scipy.org/Additional_Documentation -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Technicalities of the SVN - GIT transition

2010-06-01 Thread Pauli Virtanen
. I don't know how we should proceed here. I don't think correcting the email addresses in the SVN history is very useful. Best probably just use some dummy form, maybe forename.surn...@localhost or something similar to keep things simple. -- Pauli Virtanen

Re: [Numpy-discussion] Technicalities of the SVN - GIT transition

2010-06-05 Thread Pauli Virtanen
, as what goes into the history is the Git ID: name + email address. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Technicalities of the SVN - GIT transition

2010-06-05 Thread Pauli Virtanen
Fri, 04 Jun 2010 15:19:27 -0700, Dan Roberts wrote: Sorry to interrupt, but do you have a usable, up to date cloneable git repository somewhere? I noticed that you had a repository on github, but it's about a month out of date. I understand if what you're working on isn't ready to be cloned

Re: [Numpy-discussion] numpy.savez does /not/ compress!?

2010-06-08 Thread Pauli Virtanen
. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Problems with get_info installing scipy

2010-06-08 Thread Pauli Virtanen
somewhere that overrides the new one. Check import numpy; print numpy.__file__ to see which one is imported. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] NumPy re-factoring project

2010-06-10 Thread Pauli Virtanen
probably be shared between different openmp threads. So one would have to do some extra work to parallelize these parts manually. But probably if multithreading is desired, openmp sounds like the way to go... -- Pauli Virtanen ___ NumPy-Discussion

Re: [Numpy-discussion] NumPy re-factoring project

2010-06-11 Thread Pauli Virtanen
for each operation, currently we do one function indirection per iteration which probably costs something. But again, it may be that the operations are already bounded by memory speed, and this would not improve performance. -- Pauli Virtanen ___ NumPy

Re: [Numpy-discussion] NumPy re-factoring project

2010-06-11 Thread Pauli Virtanen
do this, as nobody should depend on this assumption. I think I there was some code ready to implement this shuffling. I'll try to dig it out and implement the shuffling. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] NumPy re-factoring project

2010-06-11 Thread Pauli Virtanen
loop. This must then be compared to the memory access overhead involved in the dtype** array. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Tensor contraction

2010-06-12 Thread Pauli Virtanen
) if the index dimensions are not all next to each other, then the shape of the result array is (broadcast shape of indices) + (non-index dimensions) Might be a bit surprising, but at this point it's not going to be changed. -- Pauli Virtanen

Re: [Numpy-discussion] Tensor contraction

2010-06-12 Thread Pauli Virtanen
Sat, 12 Jun 2010 16:30:14 -0400, Alan Bromborsky wrote: If I have a single numpy array, for example with 3 indices T_{ijk} and I want to sum over two them in the sense of tensor contraction - T_{k} = \sum_{i=0}^{n-1} T_{iik}. Is there an easy way to do this with numpy? HTH, (not really

Re: [Numpy-discussion] NumPy re-factoring project

2010-06-13 Thread Pauli Virtanen
for temporary arrays, although then one would have to be careful not ever to return memory allocated by this back to the caller. have two C functions, the first determining the amount of allocation, the second doing the computation. That sounds like a PITA, think about LAPACK. -- Pauli Virtanen

Re: [Numpy-discussion] PyArray_Scalar() and Unicode

2010-06-13 Thread Pauli Virtanen
. Conversion to real UCS-2 from UCS-4 would be a lossy procedure, since not all code points can be represented with 2 bytes. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Technicalities of the SVN - GIT transition

2010-06-15 Thread Pauli Virtanen
of a mirror, the master SVN mirror is here: http://projects.scipy.org/git/numpy/ -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] Ufunc memory access optimization

2010-06-15 Thread Pauli Virtanen
pe, 2010-06-11 kello 10:52 +0200, Hans Meine kirjoitti: On Friday 11 June 2010 10:38:28 Pauli Virtanen wrote: [clip] I think I there was some code ready to implement this shuffling. I'll try to dig it out and implement the shuffling. That would be great! Ullrich Köthe has implemented

Re: [Numpy-discussion] Ufunc memory access optimization

2010-06-15 Thread Pauli Virtanen
expressions. Perhaps there should be a subtle bias towards C-order? But I'm not sure this is worth the bother. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Ufunc memory access optimization

2010-06-15 Thread Pauli Virtanen
orders for linear algebra. So we shouldn't expect it to be simple. Yes, I do not think any of us is expecting it to be simple. I don't think we can aim for the optimal solution, since it is ill-defined, but only for one that is good enough in practice. -- Pauli Virtanen

Re: [Numpy-discussion] checking for array type in C extension

2010-06-18 Thread Pauli Virtanen
pe, 2010-06-18 kello 12:49 +0200, Berthold Hoellmann kirjoitti: [clip] tst.inttestfunc(np.array((1,2),dtype=np.int)) tst.inttestfunc(np.array((1,2),dtype=np.int8)) tst.inttestfunc(np.array((1,2),dtype=np.int16)) tst.inttestfunc(np.array((1,2),dtype=np.int32))

Re: [Numpy-discussion] checking for array type in C extension

2010-06-18 Thread Pauli Virtanen
to C int is IIRC numpy.intc, which should result to the same sizes as NPY_INT. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Multiplying numpy floats and python lists

2010-06-20 Thread Pauli Virtanen
type is not supposed to have a non-NULL in the nb_index slot. Indeed, a np.float64.__index__ method does not exist, and the following indeed does not work: [1, 2, 3][np.float64(2.2)] Strange. -- Pauli Virtanen ___ NumPy-Discussion mailing

Re: [Numpy-discussion] Possible to use numexpr with user made ufuncs/scipy ufuncs?

2010-06-26 Thread Pauli Virtanen
it be possible to add generic support for user-supplied ufuncs into numexpr? This would maybe be more of a convenience feature than a speed improvement, although perhaps some speed could be gained by evaluating ufuncs per-block. -- Pauli Virtanen ___ NumPy

Re: [Numpy-discussion] Possible to use numexpr with user made ufuncs/scipy ufuncs?

2010-06-26 Thread Pauli Virtanen
function. It's of course possible to precompute the value of iv(0, x), but this is extra hassle and requires additional memory. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy

Re: [Numpy-discussion] numpy.random.poisson docs missing Returns

2010-06-27 Thread Pauli Virtanen
. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] arr.copy(order='F') doesn't agree with docstring: what is intended behavior?

2010-06-27 Thread Pauli Virtanen
is using PyArg_ParseTuple instead of PyArg_ParseTupleAndKeywords Who do I contact about getting a trac account? Go to http://projects.scipy.org/numpy/ and select Register. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http

Re: [Numpy-discussion] Possible to use numexpr with user made ufuncs/scipy ufuncs?

2010-06-28 Thread Pauli Virtanen
with MKL) could come from using faster implementations of sin/cos/exp etc. basic functions. Using SIMD to maximum effect would then require an amount of cleverness in re-writing the evaluation algorithms, which sounds like a major amount of work. -- Pauli Virtanen

Re: [Numpy-discussion] numpy.load raising IOError but EOFError expected

2010-06-28 Thread Pauli Virtanen
ke, 2010-06-23 kello 12:46 +0200, Ruben Salvador kirjoitti: [clip] how can I detect the EOF to stop reading r = f.read(1) if not r: break # EOF else: f.seek(-1, 1) -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion

Re: [Numpy-discussion] numpy.load raising IOError but EOFError expected

2010-06-28 Thread Pauli Virtanen
to unpickle, if it doesn't see the .npy magic header. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] sum up to a specific value

2010-07-01 Thread Pauli Virtanen
Thu, 01 Jul 2010 06:17:50 -0300, Renato Fabbri wrote: i need to find which elements of an array sums up to an specific value any idea of how to do this? Sounds like the knapsack problem http://en.wikipedia.org/wiki/Knapsack_problem ___

Re: [Numpy-discussion] sum up to a specific value

2010-07-01 Thread Pauli Virtanen
to try on Google: http://www.google.com/search?q=subset%20sum%20dynamic%20programming Generic advice only this time, sorry; I don't have pre-made code for solving this at hand, but hopefully the above links give some pointers for what to do. -- Pauli Virtanen

Re: [Numpy-discussion] memory leak using numpy and cvxopt

2010-07-02 Thread Pauli Virtanen
matrix N = 2000 X = [0]*N Y = matrix(0.0, (N, N)) while True: Y[:N, :1] = X -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Numpy 1.5 for Python 2.7 and 3.1

2010-07-03 Thread Pauli Virtanen
/test_io.py - numpy/core/include/numpy/npy_math.h -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] PATCH: reference leaks for 'numpy.core._internal' module object

2010-07-03 Thread Pauli Virtanen
calling Python code... Of course, complaints without patches should not be taken too seriously ;-) We'll optimize once someone complains this makes their code slow ;) -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http

[Numpy-discussion] [OT] Re: debian benchmarks

2010-07-04 Thread Pauli Virtanen
Lua's default implementation may be efficient. At least in the mandelbrot example some things differ. I wonder if Lua there takes advantage of SIMD instructions because the author of the code has manually changed the inmost loop to process two elements at once? -- Pauli Virtanen

Re: [Numpy-discussion] subtle behavior when subtracting sub-arrays

2010-07-05 Thread Pauli Virtanen
is changed during the loop, while in the former case, numpy makes a copy of a[...,0] ? Correct. Is this intended? Not really. It's a feature we're planning to get rid of eventually, once a way to do it without sacrificing performance in safe cases is implemented. -- Pauli Virtanen

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

2010-07-10 Thread Pauli Virtanen
is localised on the older EPD-6.1-1. The question is: do you need to support this older version of EPD at all? The problem does not appear to be that matplotlib has stopped plotting masked arrays properly, or that something crucial has changed in Numpy. -- Pauli Virtanen

[Numpy-discussion] ANN: Numpy runs on Python 3

2010-07-10 Thread Pauli Virtanen
by our PR department @ EuroScipy :) -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Difference between shape=() and shape=(1,)

2010-07-13 Thread Pauli Virtanen
ti, 2010-07-13 kello 10:06 -0700, Keith Goodman kirjoitti: No need to use where. You can just do a[np.isnan(a)] = 0. But you do have to watch out for 0d arrays, can't index into those. You can, but the index must be appropriate: x = np.array(4) x[()] = 3 x array(3)

Re: [Numpy-discussion] isinf raises in inf

2010-07-15 Thread Pauli Virtanen
replace it by the obvious ((x) == NPY_INFINITY || (x) == -NPY_INFINITY) which is true only for +-inf, and cannot raise any FPU exceptions. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org

Re: [Numpy-discussion] isinf raises in inf

2010-07-16 Thread Pauli Virtanen
Testing with arithmetic can raise overflows and underflows. I think the correct isinf is to compare to NPY_INFINITY and -NPY_INFINITY. Patch is attached to #1500 - Alkuperäinen viesti - On Thu, Jul 15, 2010 at 6:42 PM, John Hunter jdh2...@gmail.com wrote: On Thu, Jul 15, 2010 at

Re: [Numpy-discussion] isinf raises in inf

2010-07-16 Thread Pauli Virtanen
); } This function can generate overflows, for example for x = 0.6 * np.finfo(np.float64).max -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] [SciPy-User] Saving Complex Numbers

2010-07-16 Thread Pauli Virtanen
the culprit is at scalarmathmodule.c.src:1023. It should at least be changed to raise a ComplexWarning, which we now anyway do in casting. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo

Re: [Numpy-discussion] __array__struct__: about using PyCapsule instead of PyCObject for Python 2.7

2010-07-17 Thread Pauli Virtanen
this to Numpy SVN soon. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] 1.5.x branched

2010-07-17 Thread Pauli Virtanen
) Support Python 3.1 and 2.7. I expect it will be easy to track changes in the trunk, even if preparing the release will still take some time. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman

Re: [Numpy-discussion] PyDocWeb the doc editor and github transition

2010-07-17 Thread Pauli Virtanen
replacing svn checkout ... svn update by git clone ... git pull ... in a shell script, and clearing up the checkout directories. I can take care of this on the server machine, once the move to git has been made. -- Pauli Virtanen

Re: [Numpy-discussion] Numpy svn down

2010-07-17 Thread Pauli Virtanen
Sat, 17 Jul 2010 16:06:40 -0600, Charles R Harris wrote: At the moment... Chuck Worksforme at the moment. Pauli ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] 1.5.x branched

2010-07-18 Thread Pauli Virtanen
Sun, 18 Jul 2010 21:13:43 +0800, Ralf Gommers wrote: [clip] Builds fine on OS X 10.6 with both 2.7 and 3.1, and all tests pass. With one exception: in-place build for 3.1 is broken. Does anyone know is this is a distutils or numpy issue? The problem is that on import numpy.__config__ can not

[Numpy-discussion] Caching 2to3 results

2010-07-18 Thread Pauli Virtanen
[shameless plug] For those of you tired of waiting for 2to3 after rm -rf build: http://github.com/pv/lib2to3cache and cd numpy/ USE_2TO3CACHE=1 python3 setup.py build -- Pauli Virtanen ___ NumPy-Discussion mailing list

Re: [Numpy-discussion] numpy Trac emails

2010-07-18 Thread Pauli Virtanen
) -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] Complex nan ordering

2010-07-18 Thread Pauli Virtanen
are welcome. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Complex nan ordering

2010-07-18 Thread Pauli Virtanen
Sun, 18 Jul 2010 15:57:47 -0600, Charles R Harris wrote: On Sun, Jul 18, 2010 at 3:36 PM, Pauli Virtanen p...@iki.fi wrote: [clip] I suggest the following, aping the way the real nan works: - (z, nan), (nan, z), (nan, nan), where z is any fp value, are all equivalent representations of cnan

Re: [Numpy-discussion] Complex nan ordering

2010-07-19 Thread Pauli Virtanen
However, nans have been propagated by maximum and minimum since 1.4.0. There was a question, discussed on the list, as to what 'nan' complex to return in the propagation, but it was still a nan complex in your definition of such objects. The final choice was driven by using the first of the

Re: [Numpy-discussion] Complex128

2010-07-19 Thread Pauli Virtanen
np.array([0,0], dtype=np.complex256) -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] recarray slow?

2010-07-21 Thread Pauli Virtanen
this. http://docs.scipy.org/doc/numpy/reference/routines.set.html -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] summarizing blocks of an array using a moving window

2010-07-22 Thread Pauli Virtanen
, those can be emulated with strides: http://mentat.za.net/numpy/scipy2009/stefanv_numpy_advanced.pdf http://conference.scipy.org/scipy2010/slides/tutorials /stefan_vd_walt_numpy_advanced.pdf -- Pauli Virtanen ___ NumPy-Discussion

Re: [Numpy-discussion] Can't get ufunc to work for integers

2010-07-22 Thread Pauli Virtanen
the C int type happens to be. Maybe someone can correct me here, but AFAIK it goes like so. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] subtract.reduce behavior

2010-07-22 Thread Pauli Virtanen
Thu, 22 Jul 2010 15:00:50 -0500, Johann Hibschman wrote: [clip] Now, I'm on an older version (1.3.0), which might be the problem, but which is correct here, the code or the docs? The documentation is incorrect. -- Pauli Virtanen ___ NumPy

Re: [Numpy-discussion] Arrays of Python Values

2010-07-23 Thread Pauli Virtanen
the different attributes (or specifically, how to keep them together during a sort). What're my options? One option could be to use structured arrays to store the data, instead of Python objects. -- Pauli Virtanen ___ NumPy-Discussion mailing list

Re: [Numpy-discussion] subtract.reduce behavior

2010-07-23 Thread Pauli Virtanen
that changing reduce behavior would require us to special-case the above two operations. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] subtract.reduce behavior

2010-07-23 Thread Pauli Virtanen
that is otherwise a *left* fold is very odd, no matter how you slice it. That is what looks like special casing... I think I see your point now. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman

<    1   2   3   4   5   6   7   8   9   10   >