[Numpy-discussion] numpy errors on MacOS but works on Ubuntu

2011-12-22 Thread Håkan Jonsson
Hi, I am running the same code on Ubuntu 10.04 and MacOS 10.7 with different results. On Ubuntu, it reads a dataset from a .mat Matlab file, and then tries to access specific values. On MacOS I get: Done loading matlab data. Traceback (most recent call last): File "parse_proximity.py", line

Re: [Numpy-discussion] Binning

2011-12-22 Thread josef . pktd
On Thu, Dec 22, 2011 at 11:39 AM, Adrien wrote: > Le 22/12/2011 17:17, josef.p...@gmail.com a écrit : >> On Thu, Dec 22, 2011 at 6:27 AM, Adrien Gaidon  wrote: >>> Hello Nicola, >>> >>> I am not aware of a magical "one function" numpy solution (is there one >>> numpy gurus?). >>> >>> I don't know

[Numpy-discussion] unexpected behavior of __array_wrap__ in matrix subclass

2011-12-22 Thread Aronne Merrelli
Hello NumPy list, While experimenting with a subclass of numpy.matrix, I discovered cases where __array_wrap__ is not called during multiplication. I'm not sure whether this is a bug or my own misunderstanding of np.matrix & __array_wrap__; if nothing else I thought it would be helpful to describe

Re: [Numpy-discussion] output different columns of ndarray in different formats

2011-12-22 Thread Chao YUE
O Yes You're right... It's fine now. Merry Christmas to all! Chao 2011/12/22 Aronne Merrelli > > > On Thu, Dec 22, 2011 at 10:27 AM, Chao YUE wrote: > >> Dear all, >> >> Just a small question, how can I output different columns of ndarray in >> different formats, >> the manual says, "

Re: [Numpy-discussion] Binning

2011-12-22 Thread Adrien
Le 22/12/2011 17:17, josef.p...@gmail.com a écrit : > On Thu, Dec 22, 2011 at 6:27 AM, Adrien Gaidon wrote: >> Hello Nicola, >> >> I am not aware of a magical "one function" numpy solution (is there one >> numpy gurus?). >> >> I don't know if it's optimal, but here's how I usually do similar thing

Re: [Numpy-discussion] output different columns of ndarray in different formats

2011-12-22 Thread Aronne Merrelli
On Thu, Dec 22, 2011 at 10:27 AM, Chao YUE wrote: > Dear all, > > Just a small question, how can I output different columns of ndarray in > different formats, > the manual says, "A single format (%10.5f), a sequence of formats, or a > multi-format string" > but I use > > np.savetxt('new.csv',data

[Numpy-discussion] output different columns of ndarray in different formats

2011-12-22 Thread Chao YUE
Dear all, Just a small question, how can I output different columns of ndarray in different formats, the manual says, "A single format (%10.5f), a sequence of formats, or a multi-format string" but I use np.savetxt('new.csv',data,fmt=['%i4','%f6.3']) or np.savetxt('new.csv',data,fmt=('%i4','%f6

Re: [Numpy-discussion] Binning

2011-12-22 Thread josef . pktd
On Thu, Dec 22, 2011 at 11:17 AM, wrote: > On Thu, Dec 22, 2011 at 6:27 AM, Adrien Gaidon wrote: >> Hello Nicola, >> >> I am not aware of a magical "one function" numpy solution (is there one >> numpy gurus?). >> >> I don't know if it's optimal, but here's how I usually do similar things. >> >>

Re: [Numpy-discussion] Binning

2011-12-22 Thread josef . pktd
On Thu, Dec 22, 2011 at 6:27 AM, Adrien Gaidon wrote: > Hello Nicola, > > I am not aware of a magical "one function" numpy solution (is there one > numpy gurus?). > > I don't know if it's optimal, but here's how I usually do similar things. > > I wrote a simple function that assigns points (any nu

Re: [Numpy-discussion] Binning

2011-12-22 Thread Adrien Gaidon
Hello Nicola, I am not aware of a magical "one function" numpy solution (is there one numpy gurus?). I don't know if it's optimal, but here's how I usually do similar things. I wrote a simple function that assigns points (any number of dimensions) to a regular multi-dimensional grid. It is here:

[Numpy-discussion] Binning

2011-12-22 Thread Nicola Creati
Hello, I have a cloud on sparse points that can be described by a Nx3 array (N is the number of points). Each point is defined by an x, y and z coordinate: x0 y0 z0 x1 y1 z1 ... ... ... xn yn zn I need to bin the cloud to a regular 2D array according to a desir