Re: [Numpy-discussion] whitespace in git repo

2010-10-19 Thread Charles R Harris
On Tue, Oct 19, 2010 at 11:17 AM, Friedrich Romstedt < friedrichromst...@gmail.com> wrote: > 2010/10/19 Darren Dale : > > We have been discussing whitespace and line endings at the following > > pull request: http://github.com/numpy/numpy/pull/4 . Chuck suggested > > we discuss it here on the list

Re: [Numpy-discussion] how to ask numpy what bit version it is running (32/64)

2010-10-19 Thread Mark Wiebe
What about this as a possibility: >>> numpy.intp(0).itemsize == 8 True -Mark On Tue, Oct 19, 2010 at 7:11 PM, Vincent Davis wrote: > A little followup from the python list. I thought this was worth sharing > here. > > Quoting Ned Deily, n...@acm.org > > " > It looks better but , > unfortunately

Re: [Numpy-discussion] how to ask numpy what bit version it is running (32/64)

2010-10-19 Thread Vincent Davis
A little followup from the python list. I thought this was worth sharing here. Quoting Ned Deily, n...@acm.org " It looks better but , unfortunately, it doesn't work correctly on OS X where a universal build can have both 32-bit and 64-bit executables in the same file. $ arch -x86_64 /usr/local/

Re: [Numpy-discussion] Count occurrences in a nested ndarray

2010-10-19 Thread Lutz Maibaum
On Oct 19, 2010, at 6:09 PM, Dewald Pieterse wrote: > for xiter in range(xindex): > for yiter in range(yindex): > if edges[xiter,yiter,:] == [255,0,0]: > groenpixelarea = groenpixelarea + 1 > if edges[xiter,yiter,:] == [0,255,0]: >

Re: [Numpy-discussion] Count occurrences in a nested ndarray

2010-10-19 Thread josef . pktd
On Tue, Oct 19, 2010 at 9:09 PM, Dewald Pieterse wrote: > Hi All > I have a nested array created using: > edges = scipy.misc.pilutil.imfilter(prent,'find_edges') > edges > array([[[  0, 255,   0], >         [  0, 255,   0], >         [  0, 255,   0], >         ..., >         [  0, 255,   0], >   

[Numpy-discussion] Count occurrences in a nested ndarray

2010-10-19 Thread Dewald Pieterse
Hi All I have a nested array created using: edges = scipy.misc.pilutil.imfilter(prent,'find_edges') edges array([[[ 0, 255, 0], [ 0, 255, 0], [ 0, 255, 0], ..., [ 0, 255, 0], [ 0, 255, 0], [ 0, 255, 0]], [[ 0, 255, 0],

Re: [Numpy-discussion] how to ask numpy what bit version it is running (32/64)

2010-10-19 Thread Vincent Davis
On Tue, Oct 19, 2010 at 4:13 PM, Jonathan Rocher wrote: > Hi, > > If you directly want to know if it is a 32 or 64 bits, you can also use > import platform > print platform.architecture() > > Best, > Jonathan > > On Tue, Oct 19, 2010 at 5:09 PM, David Cournapeau > wrote: >> >> On Wed, Oct 20, 201

Re: [Numpy-discussion] how to ask numpy what bit version it is running (32/64)

2010-10-19 Thread Jonathan Rocher
Hi, If you directly want to know if it is a 32 or 64 bits, you can also use import platform print platform.architecture() Best, Jonathan On Tue, Oct 19, 2010 at 5:09 PM, David Cournapeau wrote: > On Wed, Oct 20, 2010 at 6:54 AM, Vincent Davis > wrote: > > What is the best/good way to know what

Re: [Numpy-discussion] how to ask numpy what bit version it is running (32/64)

2010-10-19 Thread David Cournapeau
On Wed, Oct 20, 2010 at 6:54 AM, Vincent Davis wrote: > What is the best/good way to know what version of numpy is running (32 > or 64 bit). import platform print platform.machine() > Showing my ignorance maybe but does it always match the python version > that is running, which can be ask/teste

[Numpy-discussion] how to ask numpy what bit version it is running (32/64)

2010-10-19 Thread Vincent Davis
What is the best/good way to know what version of numpy is running (32 or 64 bit). Showing my ignorance maybe but does it always match the python version that is running, which can be ask/tested using sys.maxint? -- Thanks Vincent Davis ___ NumPy-Discus

Re: [Numpy-discussion] patch for structured array comparison bug

2010-10-19 Thread Mark Wiebe
On Tue, Oct 19, 2010 at 12:35 PM, Charles R Harris < charlesr.har...@gmail.com> wrote: > >> > We're still working things out after the move, so you get to be sort of a > guinea pig ;) I think a pull request is the way to go. > Sounds good. :) > > > You can request a pull of the branch. Just

[Numpy-discussion] in1d for structure arrays

2010-10-19 Thread Jeremy Lewi
Hi, I noticed that the recent numpy (1.5) implements the function in1d in set operations. Unfortunately this doesn't seem to work for structure arrays because "mergesort" isn't implemented for structure arrays. I was able to implement a quick work-around simply by adding a structure field t

Re: [Numpy-discussion] patch for structured array comparison bug

2010-10-19 Thread Charles R Harris
On Tue, Oct 19, 2010 at 1:00 PM, Mark Wiebe wrote: > On Tue, Oct 19, 2010 at 2:24 AM, Pauli Virtanen wrote: > >> Tue, 19 Oct 2010 01:09:54 -0600, Charles R Harris wrote: >> [clip] >> > Just a quick look. I wasn't able to add comments to the code, maybe a >> > pull request would allow that or may

Re: [Numpy-discussion] patch for structured array comparison bug

2010-10-19 Thread Mark Wiebe
On Tue, Oct 19, 2010 at 2:24 AM, Pauli Virtanen wrote: > Tue, 19 Oct 2010 01:09:54 -0600, Charles R Harris wrote: > [clip] > > Just a quick look. I wasn't able to add comments to the code, maybe a > > pull request would allow that or maybe you need to enable something. > > I think you can only ad

Re: [Numpy-discussion] whitespace in git repo

2010-10-19 Thread Friedrich Romstedt
2010/10/19 Darren Dale : > We have been discussing whitespace and line endings at the following > pull request: http://github.com/numpy/numpy/pull/4 . Chuck suggested > we discuss it here on the list. > > I have the following set in my ~/.gitconfig file: > >    [apply] >        whitespace = fix > >

Re: [Numpy-discussion] stride tricks for cellular automata

2010-10-19 Thread Vincent Davis
On Mon, Oct 18, 2010 at 11:54 AM, Robert Cimrman wrote: > FYI: I have added a new Cookbook entry, see [1], hoping that it might be > useful to someone. > > The stride tricks are awesome! Thanks for the entry, I was looking for something similar for a problem I was thinking about. Not sure strides

Re: [Numpy-discussion] [numpy-discussion] Transform 3d data

2010-10-19 Thread Nadav Horesh
Of course there is an (at least one) error: the line should be: XYZ = np.mgrid[lwrbnd[0]:uprbnd[0]:shape[0]*1j,lwrbnd[1]:uprbnd[1]:shape[1]*1j, lwrbnd[2]:uprbnd[2]:shape[2]*1j] On Tue, 2010-10-19 at 14:10 +0200, Nadav Horesh wrote: > You can aid mgrid, riughy as the follows (I may have mistakes

[Numpy-discussion] whitespace in git repo

2010-10-19 Thread Darren Dale
We have been discussing whitespace and line endings at the following pull request: http://github.com/numpy/numpy/pull/4 . Chuck suggested we discuss it here on the list. I have the following set in my ~/.gitconfig file: [apply] whitespace = fix [core] autocrlf = input wh

Re: [Numpy-discussion] [numpy-discussion] Transform 3d data

2010-10-19 Thread Nadav Horesh
You can aid mgrid, riughy as the follows (I may have mistakes, but the direction should be clear): def transform_3d_data_(field,lwrbnd,uprbnd): shape = field.shape XYZ = np.mgrid[lwrbnd[0]:uprbnd[0]:shape[0], lwrbnd[1]:uprbnd[1]:shape[1], lwrbnd[2]:uprbnd[2]:shape[2]] vectors = fields.resh

[Numpy-discussion] [numpy-discussion] Transform 3d data

2010-10-19 Thread Thomas Königstein
Hello everyone, I have the following problem: I acquire a (evenly spaced) 3d field of 3d vectors from a HDF5 data file: >>> import tables >>> field=tables.openFile("test.h5").root.YeeMagField.read() now, the data is organized in "nested arrays"... so, when I have, say, 300 data points on the x-

Re: [Numpy-discussion] numpy installation in ubuntu

2010-10-19 Thread Alex Ter-Sarkissov
thanks! it actually worked! maybe u could recommend some good sources/readin on how to install different modules in python run under linux thanks again, alex 2010/10/19 Pauli Virtanen > Tue, 19 Oct 2010 21:26:38 +1300, Alex Ter-Sarkissov wrote: > > thanks, this didn't seem to work. I get a who

Re: [Numpy-discussion] patch for structured array comparison bug

2010-10-19 Thread Pauli Virtanen
Tue, 19 Oct 2010 01:09:54 -0600, Charles R Harris wrote: [clip] > Just a quick look. I wasn't able to add comments to the code, maybe a > pull request would allow that or maybe you need to enable something. I think you can only add comments on commits, not in Github's compare view. > Also, it is

Re: [Numpy-discussion] numpy installation in ubuntu

2010-10-19 Thread Pauli Virtanen
Tue, 19 Oct 2010 21:26:38 +1300, Alex Ter-Sarkissov wrote: > thanks, this didn't seem to work. I get a whole range of errors, most > importantly > > SystemError: Cannot compiler 'Python.h'. Perhaps you need to install > python-dev|python-devel. I think you should do "sudo apt-get install python-d

Re: [Numpy-discussion] numpy installation in ubuntu

2010-10-19 Thread Alex Ter-Sarkissov
thanks, this didn't seem to work. I get a whole range of errors, most importantly SystemError: Cannot compiler 'Python.h'. Perhaps you need to install python-dev|python-devel. Apparently, according to numpy installation guide (here

Re: [Numpy-discussion] patch for structured array comparison bug

2010-10-19 Thread Charles R Harris
On Mon, Oct 18, 2010 at 7:13 PM, Mark Wiebe wrote: > I found a bug in structured array comparison when fields have > multi-dimensional types. I created a ticket here: > > http://projects.scipy.org/numpy/ticket/1640 > > and a patch here: > > http://github.com/m-paradox/numpy/compare/master...fix_