[Numpy-discussion] converting "numpy.bytes_" from numpy 1.7.0 to "numpy.string_" of numpy 1.6.1

2013-04-07 Thread Sergio Rojas
an-00'" In [10]: str(d[1]).lstrip('b')[0] In [11]: str(d[1]).lstrip('b')[0] Out[10]: '0' Out[11]: "'" I want to have extra double quotes I want to delete the double quotes enclosing the string stored in d[1] enclosing the string stored in d

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

2013-03-24 Thread Sergio Pascual
This is the closer I got to do what you say http://numpy-discussion.10968.n7.nabble.com/Reductions-with-nditer-working-only-with-the-last-axis-td8157.html Converts a 3D to 2D, but only works in the last axis. Any improvement would be welcomed.ç 2013/3/22 Neal Becker > I frequently find I ha

Re: [Numpy-discussion] Casting and promotion rules (e.g. int + uint64 => float)

2013-03-11 Thread Sergio Callegari
nguages (possibly following C) would do and, most important, dealing with integers, one expects overflows and wraparounds, not certainly a loss of precision. Another issue is that the promotion rule breaks indexing a = np.uint64(1) b=[0,1,2,3,4,5] b[a] -> 1 # OK b[a+1] -> Error I rea

[Numpy-discussion] Casting and promotion rules (e.g. int + uint64 => float)

2013-03-08 Thread Sergio Callegari
Hi, I have noticed that numpy introduces some unexpected type casts, that are in some cases problematic. A very weird cast is int + uint64 -> float for instance, consider the following snippet: import numpy as np a=np.uint64(1) a+1 -> 2.0 this cast is quite different from what other program

Re: [Numpy-discussion] Calling scipy blas from cython is extremely slow

2013-02-23 Thread Sergio Callegari
Partially fixed. I was messing the row, column order. For some reason this was working in some case. Now I've fixed it and it *always* works. However, it is still slower than the cblas cblas -> 0.69 sec scipy blas -> 0.74 sec Any clue why? ___ Num

Re: [Numpy-discussion] Calling scipy blas from cython is extremely slow

2013-02-23 Thread Sergio Callegari
... and it is not deterministic too... About 1 time over 6 the code calling the scipy blas gives a completely wrong result. How can this be? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discus

[Numpy-discussion] Calling scipy blas from cython is extremely slow

2013-02-23 Thread Sergio Callegari
Hi, following the excellent advice of V. Armando Sole, I have finally succeeded in calling the blas routines shipped with scipy from cython. I am doing this to avoid shipping an extra blas library for some project of mine that uses scipy but has some things coded in cython for extra speed. So fa

Re: [Numpy-discussion] Windows, blas, atlas and dlls

2013-02-22 Thread Sergio Callegari
> > from scipy.linalg.blas import fblas > dgemm = fblas.dgemm._cpointer > sgemm = fblas.sgemm._cpointer > OK, but this gives me a PyCObject. How do I make it a function pointer of the correct type in cython? Thanks again Sergio ___ N

Re: [Numpy-discussion] Windows, blas, atlas and dlls

2013-02-20 Thread Sergio
V. Armando Solé esrf.fr> writes: > from scipy.linalg.blas import fblas > dgemm = fblas.dgemm._cpointer > sgemm = fblas.sgemm._cpointer > I'm going to try and benchmark it asap. Thanks ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org h

Re: [Numpy-discussion] Windows, blas, atlas and dlls

2013-02-20 Thread Sergio
Dag Sverre Seljebotn astro.uio.no> writes: > > On 02/18/2013 05:26 PM, rif wrote: > > I have no answer to the question, but I was curious as to why directly > > calling the cblas would be 10x-20x slower in the first place. That > > seems surprising, although I'm just learning about python numer

[Numpy-discussion] Windows, blas, atlas and dlls

2013-02-18 Thread Sergio Callegari
Hi, I have a project that includes a cython script which in turn does some direct access to a couple of cblas functions. This is necessary, since some matrix multiplications need to be done inside a tight loop that gets called thousands of times. Speedup wrt calling scipy.linalg.blas.cblas routine

Re: [Numpy-discussion] Reductions with nditer working only with the last axis

2012-10-01 Thread Sergio Pascual
42 45] [48 51 54 57]] nditer_fun(data, [-1, 0, 1]) [[58 58 58 58] [58 58 58 58] [58 58 58 58]] Only along the last axis both functions give the same result 2012/10/1 Han Genuit : > On Thu, Sep 27, 2012 at 6:08 PM, Sergio Pascual > wrote: >> Hello, I'm trying to understand h

[Numpy-discussion] Reductions with nditer working only with the last axis

2012-09-27 Thread Sergio Pascual
nd giving an array of length 2 each time. I have read the numpy documentation several times and googled about this to no avail. Does anybody have an example of a reduction in the first axis of an array using nditer? Is this a bug? Regards, Sergio ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] Iterating over a given axis with buffering

2012-08-13 Thread Sergio Pascual
rsion using NpyIter. The only way I found to do the innermost loop over the third axis was passing the flag NPY_ITER_MULTI_INDEX, but then I can't use NPY_ITER_BUFFERED to handle my bitswapped, at least in numpy 1.6 they couldn't be used simultaneously. Any hint on how I can do this?

[Numpy-discussion] Limit in NpyIter_MultiNew: NPY_MAXARGS

2012-08-11 Thread Sergio Pascual
, what is the rationale to have the limit in 32 instead of, say, 1024? If this number cannot easily be increased in the source code, what is the alternative to iterate over a large number of images? Could it be an array of NpyIter objects? Regards, Sergio

Re: [Numpy-discussion] problem installing numpy on Fedora

2011-04-13 Thread Sergio Pascual
You should check if you have two different compilers installed ls /usr/bin/gcc* ? 2011/4/13 c cook : > I have Fedora Core 3 and x86_64 architecture. But I don't understand why it > appears to look for /usr/lib/gcc/x86_64-redhat-linux/3.4.4/ > instead of /usr/bin/gcc > Csaba > > On Wed, Apr 13, 20

Re: [Numpy-discussion] Extending numpy statistics functions (like mean)

2011-04-11 Thread Sergio Pascual
1, 2011 at 2:36 PM, Sergio Pascual > wrote: >> Hi list. >> >> For mi application, I would like to implement some new statistics >> functions over numpy arrays, such as truncated mean. Ideally this new >> function should have the same arguments >> than numpy.

[Numpy-discussion] Extending numpy statistics functions (like mean)

2011-04-11 Thread Sergio Pascual
in C from scratch? I have read the documentation, but as far a I see ufuncs convert a N dimensional array into another and generalized ufuncs require fixed dimensions. numpy mean converts a N dimensional array either in a number or a N - 1 dimensional array. Regards, S