Re: [Numpy-discussion] Help speeding up element-wise operations for video processing

2008-09-18 Thread Stéfan van der Walt
Hey Brendan 2008/9/17 Brendan Simons [EMAIL PROTECTED]: I would love a c-types code snippet. I'm not very handy in c. Since I gather numpy is row-major, I thought I up and down crops very quickly by moving the start and end pointers of the array. For cropping left and right, is there a

Re: [Numpy-discussion] Help speeding up element-wise operations forvideo processing

2008-09-18 Thread Nadav Horesh
Sorry for not relating to the details of the problem, but, did you take a look pygpu? It intends to be able to enable image processing as video rate. Nadav -הודעה מקורית- מאת: [EMAIL PROTECTED] בשם St?fan van der Walt נשלח: ה 18-ספטמבר-08 10:25 אל: Discussion of Numerical Python נושא:

Re: [Numpy-discussion] profiling line by line

2008-09-18 Thread Ondrej Certik
On Thu, Sep 18, 2008 at 1:29 AM, Robert Kern [EMAIL PROTECTED] wrote: On Wed, Sep 17, 2008 at 18:09, Ondrej Certik [EMAIL PROTECTED] wrote: On Wed, Sep 17, 2008 at 3:56 AM, Robert Kern [EMAIL PROTECTED] wrote: On Mon, Sep 15, 2008 at 11:13, Arnar Flatberg [EMAIL PROTECTED] wrote: That would

[Numpy-discussion] Medians that ignore values

2008-09-18 Thread Peter Saffrey
I have data from biological experiments that is represented as a list of about 5000 triples. I would like to convert this to a list of the median of each triple. I did some profiling and found that numpy was much about 12 times faster for this application than using regular Python lists and a

Re: [Numpy-discussion] Medians that ignore values

2008-09-18 Thread Nadav Horesh
I think you need to use masked arrays. Nadav -הודעה מקורית- מאת: [EMAIL PROTECTED] בשם Peter Saffrey נשלח: ה 18-ספטמבר-08 14:27 אל: numpy-discussion@scipy.org נושא: [Numpy-discussion] Medians that ignore values I have data from biological experiments that is represented as a list of

Re: [Numpy-discussion] profiling line by line

2008-09-18 Thread Ondrej Certik
On Thu, Sep 18, 2008 at 1:01 PM, Robert Cimrman [EMAIL PROTECTED] wrote: Hi Robert, Robert Kern wrote: On Mon, Sep 15, 2008 at 11:13, Arnar Flatberg [EMAIL PROTECTED] wrote: That would make me an extremely happy user, I've been looking for this for years! I can't imagine I'm the only one

Re: [Numpy-discussion] Medians that ignore values

2008-09-18 Thread Bruce Southey
Nadav Horesh wrote: I think you need to use masked arrays. Nadav -הודעה מקורית- מאת: [EMAIL PROTECTED] בשם Peter Saffrey נשלח: ה 18-ספטמבר-08 14:27 אל: numpy-discussion@scipy.org נושא: [Numpy-discussion] Medians that ignore values I have data from biological experiments

Re: [Numpy-discussion] profiling line by line

2008-09-18 Thread Ryan May
Ondrej Certik wrote: On Thu, Sep 18, 2008 at 1:01 PM, Robert Cimrman [EMAIL PROTECTED] wrote: It requires Cython and a C compiler to build. I'm still debating myself about the desired workflow for using it, but for now, it only profiles functions which you have registered with it. I have made

Re: [Numpy-discussion] Medians that ignore values

2008-09-18 Thread jh
You might want to try isfinite() to first remove nan, +/- infinity before doing that. numpy.median(a[numpy.isfinite(a)]) We just had this discussion a month or two ago, I think even on this list, and continued it at the SciPy conference. The problem with numpy.median(a[numpy.isfinite(a)])

Re: [Numpy-discussion] profiling line by line

2008-09-18 Thread Ondrej Certik
So the timing raises a lot. For obvious reasons, that's the overhead of the profiler. But the problem is that then the timings just don't fit, e.g. if I sum the total time spent in subfunctions, it doesn't account for all the time printed on the respective line in the parent function. I

Re: [Numpy-discussion] profiling line by line

2008-09-18 Thread Arnar Flatberg
On Wed, Sep 17, 2008 at 10:33 PM, Robert Kern [EMAIL PROTECTED] wrote: On Wed, Sep 17, 2008 at 07:12, Arnar Flatberg [EMAIL PROTECTED] wrote: On Wed, Sep 17, 2008 at 3:56 AM, Robert Kern [EMAIL PROTECTED] wrote: It should be straightforward to make an ipython %magic, yes. There are

Re: [Numpy-discussion] Medians that ignore values

2008-09-18 Thread Pierre GM
On Thursday 18 September 2008 13:31:18 Peter Saffrey wrote: The version in the Ubuntu package repository. It says 1:1.0.4-6ubuntu3. So it's 1.0 ? It's fairly old, that would explain. if you don't give an axis parameter, you should get the median of the flattened array, therefore a scalar,

[Numpy-discussion] ready to tag 1.2.0

2008-09-18 Thread Jarrod Millman
Hey, I would like to tag 1.2.0 from the 1.2.x branch. Are there any problems with this? In particular, are there any known problems that would require us having another release candidate? As soon as we get this release out we can start back-porting bugfixes from the trunk to the 1.2.x branch

Re: [Numpy-discussion] profiling line by line

2008-09-18 Thread Robert Kern
On Thu, Sep 18, 2008 at 06:01, Robert Cimrman [EMAIL PROTECTED] wrote: Hi Robert, Robert Kern wrote: On Mon, Sep 15, 2008 at 11:13, Arnar Flatberg [EMAIL PROTECTED] wrote: That would make me an extremely happy user, I've been looking for this for years! I can't imagine I'm the only one who

Re: [Numpy-discussion] profiling line by line

2008-09-18 Thread Robert Kern
On Thu, Sep 18, 2008 at 10:03, Ondrej Certik [EMAIL PROTECTED] wrote: Anyway, back to work: Robert K., I noticed that if I profile some function, I get results like this for example: 40 307246952 6.6 [x,w] = p_roots(n) 41 307224192 3.4

[Numpy-discussion] A bug in loadtxt and how to convert a string array (hex data) to decimal?

2008-09-18 Thread frank wang
Hi, All, I have found a bug in the loadtxt function. Here is the example. The file name is test.txt and contains: Thist is test 3FF 3fE 3Ef 3e8 3Df 3d9 3cF 3c7 In the Python 2.5.2, I type: test=loadtxt('test.txt',comments='',dtype='string',converters={0:lambda s:int(s,16)}) test will

Re: [Numpy-discussion] A bug in loadtxt and how to convert a string array (hex data) to decimal?

2008-09-18 Thread Ryan May
frank wang wrote: Hi, All, I have found a bug in the loadtxt function. Here is the example. The file name is test.txt and contains: Thist is test 3FF 3fE 3Ef 3e8 3Df 3d9 3cF 3c7 In the Python 2.5.2, I type:

[Numpy-discussion] Generating random samples without repeats

2008-09-18 Thread Paul Moore
I want to generate a series of random samples, to do simulations based on them. Essentially, I want to be able to produce a SAMPLESIZE * N matrix, where each row of N values consists of either 1. Integers between 1 and M (simulating M rolls of an N-sided die), or 2. A sample of N numbers

Re: [Numpy-discussion] Generating random samples without repeats

2008-09-18 Thread Robert Kern
On Thu, Sep 18, 2008 at 16:55, Paul Moore [EMAIL PROTECTED] wrote: I want to generate a series of random samples, to do simulations based on them. Essentially, I want to be able to produce a SAMPLESIZE * N matrix, where each row of N values consists of either 1. Integers between 1 and M

Re: [Numpy-discussion] A bug in loadtxt and how to convert a string array (hex data) to decimal?

2008-09-18 Thread frank wang
Hi, Ryan, Thank you very much. It solves my problem. I have struggled with this for long time. Frank Date: Thu, 18 Sep 2008 16:39:47 -0500 From: [EMAIL PROTECTED] To: numpy-discussion@scipy.org Subject: Re: [Numpy-discussion] A bug in loadtxt and how to convert a string array (hex data) to

Re: [Numpy-discussion] profiling line by line

2008-09-18 Thread Gael Varoquaux
On Thu, Sep 18, 2008 at 02:54:13PM -0500, Robert Kern wrote: So here's what going on: I'm being clever (and possibly too clever). Oh no. Robert K. is too clever. We knew that, right ;). Gaël ___ Numpy-discussion mailing list Numpy-discussion@scipy.org

Re: [Numpy-discussion] building numpy locally but get error: undefined symbol: zgesdd_

2008-09-18 Thread David Cournapeau
Francis wrote: Thank you for your effort. I guess garnumpy reflects the idea in this Pylab discussion: http://www.scipy.org/PyLab Again I get errors in libblas/lapack related to gfortran (local variable problems). I replaced the libblas.a and the liblaplack.a by the ones of sage. And started

Re: [Numpy-discussion] building numpy locally but get error: undefined symbol: zgesdd_

2008-09-18 Thread David Cournapeau
David Cournapeau wrote: If you install blas/lapack from sage, it kind of defeats the whole purpose of garnumpy. The goal is to have a unified set of options to build. It is likely that sage uses different options than the ones from garnumpy. If you use garnumpy, you should use it for

[Numpy-discussion] Suggestion for recarray.view

2008-09-18 Thread Pierre GM
All, I'd like to submit the following suggestion for recarray.view, so that it could accept two keywords like standard ndarrays do. As a change in records.py can potentially affect a lot of people (probably more than a change in numpy.ma), I'm not confident enough to commit it. Consider that as

Re: [Numpy-discussion] Medians that ignore values

2008-09-18 Thread Anne Archibald
2008/9/18 David Cournapeau [EMAIL PROTECTED]: Peter Saffrey wrote: Is this the correct behavior for median with nan? That's the expected behavior, at least :) (this is also the expected behavior of most math packages I know, including matlab and R, so this should not be too surprising if

Re: [Numpy-discussion] Suggestion for recarray.view

2008-09-18 Thread Travis E. Oliphant
Pierre GM wrote: All, I'd like to submit the following suggestion for recarray.view, so that it could accept two keywords like standard ndarrays do. As a change in records.py can potentially affect a lot of people (probably more than a change in numpy.ma), I'm not confident enough to

[Numpy-discussion] PyUnicodeUCS2 issue with numpy revision 5833

2008-09-18 Thread JohannCT
hello, I just updated my svn repository, but I am now unable anymore to import numpy : In [1]: import numpy as np --- ImportError Traceback (most recent call last) /home/cohen/ipython console in

Re: [Numpy-discussion] Medians that ignore values

2008-09-18 Thread David Cournapeau
Anne Archibald wrote: That was in amax/amin. Pretty much every other function that does comparisons needs to be fixed to work with nans. In some cases it's not even clear how: where should a sort put the nans in an array? The problem is more on how the functions use sort than sort itself in