Re: [Numpy-discussion] efficient 3d histogram creation

2009-05-04 Thread josef . pktd
On Mon, May 4, 2009 at 12:31 AM, Chris Colbert sccolb...@gmail.com wrote: this actually sort of worked. Thanks for putting me on the right track. Here is what I ended up with. this is what I ended up with: def hist3d(imgarray):     histarray = N.zeros((16, 16, 16))     temp =

Re: [Numpy-discussion] apply table lookup to each element

2009-05-04 Thread Neal Becker
Neal Becker wrote: Suggestion for efficient way to apply a table lookup to each element of an integer array? import numpy as np _cos = np.empty ((2**rom_in_bits,), dtype=int) _sin = np.empty ((2**rom_in_bits,), dtype=int) for address in xrange (2**12): _cos[address] = nint

Re: [Numpy-discussion] apply table lookup to each element

2009-05-04 Thread Stéfan van der Walt
2009/5/4 Neal Becker ndbeck...@gmail.com: Turns out that if A is an np.array and B is an np.array, then A[B] will do exactly what I wanted. Is this mentioned anywhere in the documentation? http://docs.scipy.org/numpy/docs/numpy-docs/reference/arrays.indexing.rst/#arrays-indexing Stéfan

Re: [Numpy-discussion] Porting strategy for py3k

2009-05-04 Thread Dag Sverre Seljebotn
David Cournapeau wrote: On Mon, May 4, 2009 at 1:24 AM, Dag Sverre Seljebotn da...@student.matnat.uio.no wrote: David Cournapeau wrote: On Fri, Apr 24, 2009 at 4:49 PM, Dag Sverre Seljebotn One thing somebody *could* work on rather independently for some hours is proper PEP

Re: [Numpy-discussion] Really strange result

2009-05-04 Thread Bruce Southey
Neal Becker wrote: Charles R Harris wrote: On Fri, May 1, 2009 at 7:39 PM, Charles R Harris charlesr.har...@gmail.comwrote: On Fri, May 1, 2009 at 7:24 PM, Neal Becker ndbeck...@gmail.com wrote: Charles R Harris wrote: On Fri, May 1, 2009 at 1:02 PM, Neal

[Numpy-discussion] Efficient scaling of array

2009-05-04 Thread Johannes Bauer
Hello list, is there a possibility to scale an array by interpolation, automatically? For illustration a 1D-example would be an array of size 5, which is scaled to size 3: before: [ 1, 2, 3, 4, 5 ] 1/1 2/3 1/3 1 1/3 2/3 1 after : [

Re: [Numpy-discussion] Efficient scaling of array

2009-05-04 Thread Zachary Pincus
scipy.ndimage.zoom (and related interpolation functions) would be a good bet -- different orders of interpolation are available, too, which can be useful. Zach On May 4, 2009, at 11:40 AM, Johannes Bauer wrote: Hello list, is there a possibility to scale an array by interpolation,

[Numpy-discussion] How to convert a list into a structured array?

2009-05-04 Thread Wei Su
Hi,All:   My first post! I am very excited to find out structured array (record array) in Python. Since I do data manipulation every day, this is truly great. However, I typically download data using pyodbc, the default output is a big list. So I am wondering how to convert that big list into a

[Numpy-discussion] stop criterion for an alternating signal

2009-05-04 Thread Nils Wagner
Hi all, How can I define a stop criterion for an alternating series ? Any pointer would be appreciated. Nils from numpy import loadtxt, arange from pylab import plot, show A = loadtxt('alternate.dat') m = len(A) x = arange(0,m) plot(x,A) show() alternate.dat Description: MPEG movie

Re: [Numpy-discussion] stop criterion for an alternating signal

2009-05-04 Thread Charles R Harris
On Mon, May 4, 2009 at 10:48 AM, Nils Wagner nwag...@iam.uni-stuttgart.dewrote: Hi all, How can I define a stop criterion for an alternating series ? Any pointer would be appreciated. Where does the series come from and what are you trying to do? Chuck

Re: [Numpy-discussion] stop criterion for an alternating signal

2009-05-04 Thread Nils Wagner
On Mon, 4 May 2009 10:52:59 -0600 Charles R Harris charlesr.har...@gmail.com wrote: On Mon, May 4, 2009 at 10:48 AM, Nils Wagner nwag...@iam.uni-stuttgart.dewrote: Hi all, How can I define a stop criterion for an alternating series ? Any pointer would be appreciated. Where does the

Re: [Numpy-discussion] Efficient scaling of array

2009-05-04 Thread Johannes Bauer
Zachary Pincus schrieb: scipy.ndimage.zoom (and related interpolation functions) would be a good bet -- different orders of interpolation are available, too, which can be useful. Thanks a lot - exactly what I was looking for! Kind regards, Johannes

Re: [Numpy-discussion] Really strange result

2009-05-04 Thread Christopher Barker
Neal Becker wrote: In [3]: n=-7 In [4]: (np.linspace (0, 1023,1024).astype(np.uint64)*n).dtype Out[4]: dtype('float64') what would you like (expect) to happen when you multiply an unsigned type by a negative number? -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response

Re: [Numpy-discussion] stop criterion for an alternating signal

2009-05-04 Thread Charles R Harris
On Mon, May 4, 2009 at 10:59 AM, Nils Wagner nwag...@iam.uni-stuttgart.dewrote: On Mon, 4 May 2009 10:52:59 -0600 Charles R Harris charlesr.har...@gmail.com wrote: On Mon, May 4, 2009 at 10:48 AM, Nils Wagner nwag...@iam.uni-stuttgart.dewrote: Hi all, How can I define a stop

Re: [Numpy-discussion] efficient 3d histogram creation

2009-05-04 Thread David Huard
On Mon, May 4, 2009 at 7:00 AM, josef.p...@gmail.com wrote: On Mon, May 4, 2009 at 12:31 AM, Chris Colbert sccolb...@gmail.com wrote: this actually sort of worked. Thanks for putting me on the right track. Here is what I ended up with. this is what I ended up with: def

Re: [Numpy-discussion] efficient 3d histogram creation

2009-05-04 Thread Chris Colbert
i'll take a look at them over the next few days and see what i can hack out. Chris On Mon, May 4, 2009 at 3:18 PM, David Huard david.hu...@gmail.com wrote: On Mon, May 4, 2009 at 7:00 AM, josef.p...@gmail.com wrote: On Mon, May 4, 2009 at 12:31 AM, Chris Colbert sccolb...@gmail.com

[Numpy-discussion] loadtxt example problem ?

2009-05-04 Thread bruno Piguet
Hello, I'm new to numpy, and considering using loadtxt() to read a data file. As a starter, I tried the example of the doc page ( http://docs.scipy.org/doc/numpy/reference/generated/numpy.loadtxt.html) : from StringIO import StringIO # StringIO behaves like a file object c = StringIO(0

Re: [Numpy-discussion] loadtxt example problem ?

2009-05-04 Thread Ryan May
On Mon, May 4, 2009 at 3:06 PM, bruno Piguet bruno.pig...@gmail.com wrote: Hello, I'm new to numpy, and considering using loadtxt() to read a data file. As a starter, I tried the example of the doc page ( http://docs.scipy.org/doc/numpy/reference/generated/numpy.loadtxt.html) : from

Re: [Numpy-discussion] efficient 3d histogram creation

2009-05-04 Thread josef . pktd
On Mon, May 4, 2009 at 4:00 PM, Chris Colbert sccolb...@gmail.com wrote: i'll take a look at them over the next few days and see what i can hack out. Chris On Mon, May 4, 2009 at 3:18 PM, David Huard david.hu...@gmail.com wrote: On Mon, May 4, 2009 at 7:00 AM, josef.p...@gmail.com wrote:

[Numpy-discussion] object arrays and ==

2009-05-04 Thread David Warde-Farley
Hi, Is there a simple way to compare each element of an object array to a single object? objarray == None, for example, gives me a single False. I couldn't find any reference to it in the documentation, but I'll admit, I wasn't quite sure where to look. David

Re: [Numpy-discussion] object arrays and ==

2009-05-04 Thread Ryan May
On Mon, May 4, 2009 at 3:55 PM, David Warde-Farley d...@cs.toronto.eduwrote: Hi, Is there a simple way to compare each element of an object array to a single object? objarray == None, for example, gives me a single False. I couldn't find any reference to it in the documentation, but I'll

Re: [Numpy-discussion] object arrays and ==

2009-05-04 Thread Keith Goodman
On Mon, May 4, 2009 at 2:02 PM, Ryan May rma...@gmail.com wrote: On Mon, May 4, 2009 at 3:55 PM, David Warde-Farley d...@cs.toronto.edu wrote: Hi, Is there a simple way to compare each element of an object array to a single object? objarray == None, for example, gives me a single False. I

[Numpy-discussion] SVD failure

2009-05-04 Thread Philipp K. Janert
The following code: from scipy import * from scipy import linalg m = matrix( [ [1,1,0,0], [1,1,0,0], [0,0,1,1], [0,0,1,1] ] ) u,s,v = linalg.svd( m ) fails with the following message: Traceback (most recent call last): File boo.py,

[Numpy-discussion] FaceL - Facile Face Labeling

2009-05-04 Thread David Bolme
I have been working on a open source face recognition demo tool called FaceL for the past few months. FaceL is a simple and fun face processing and labeling tool that labels faces in a live video from an iSight camera or webcam. It uses OpenCV for face detection, ASEF correlation

Re: [Numpy-discussion] SVD failure

2009-05-04 Thread Stéfan van der Walt
Hi Philipp 2009/5/5 Philipp K. Janert pyt...@beyondcode.org: If I see this correctly, my SciPy version is 0.6.0; running on 64bit Suse 11. SciPy 0.6 is quite old, and it is likely that the problem was fixed in the mean time. On SciPy 0.7 I see: In [31]: u,s,v = linalg.svd(m) In [32]: u

Re: [Numpy-discussion] FaceL - Facile Face Labeling

2009-05-04 Thread Stéfan van der Walt
2009/5/5 David Bolme bolme1...@comcast.net: I have been working on a open source face recognition demo tool called FaceL for the past few months.   FaceL is a simple and fun face processing and labeling tool that labels faces in a live video from an iSight camera or webcam. That's really neat

Re: [Numpy-discussion] SVD failure

2009-05-04 Thread Philipp K. Janert
Thanks for the quick reply. I'll try upgrading. Best, Ph. On Monday 04 May 2009 04:21:29 pm Stéfan van der Walt wrote: Hi Philipp 2009/5/5 Philipp K. Janert pyt...@beyondcode.org: If I see this correctly, my SciPy version is 0.6.0; running on 64bit Suse 11. SciPy 0.6

Re: [Numpy-discussion] Structured array with no fields - possible?

2009-05-04 Thread Matthew Brett
Hi, I'm trying to fix a bug in the scipy matlab loading routines, and this requires me to somehow represent an empty structured array. Do you need the struct to be empty (size is 0) or to have no fields ? What would you expect np.zeros((), dtype=np.dtype([])) to return, for example ? Yes,