Re: [Numpy-discussion] Flattening an array

2009-12-09 Thread Charles R Harris
On Tue, Dec 8, 2009 at 5:29 PM, Jake VanderPlas wrote: > Hello, > I have a function -- call it f() -- which takes a length-N 1D numpy > array as an argument, and returns a length-N 1D array. > I want to pass it the data in an N-D array, and obtain the N-D array > of the result. > I've thought abo

Re: [Numpy-discussion] Assigning complex values to a real array

2009-12-09 Thread Anne Archibald
2009/12/9 Dr. Phillip M. Feldman : > > > Pauli Virtanen-3 wrote: >> >> Nevertheless, I can't really regard dropping the imaginary part a >> significant issue. >> > > I am amazed that anyone could say this.  For anyone who works with Fourier > transforms, or with electrical circuits, or with electro

Re: [Numpy-discussion] Assigning complex values to a real array

2009-12-09 Thread Scott Ransom
On Wed, Dec 09, 2009 at 05:54:07PM -0800, Dr. Phillip M. Feldman wrote: > > Pauli Virtanen-3 wrote: > > > > Nevertheless, I can't really regard dropping the imaginary part a > > significant issue. > > > > I am amazed that anyone could say this. For anyone who works with Fourier > transforms, o

Re: [Numpy-discussion] Assigning complex values to a real array

2009-12-09 Thread Dr. Phillip M. Feldman
Pauli Virtanen-3 wrote: > > Nevertheless, I can't really regard dropping the imaginary part a > significant issue. > I am amazed that anyone could say this. For anyone who works with Fourier transforms, or with electrical circuits, or with electromagnetic waves, dropping the imaginary part is

Re: [Numpy-discussion] Assigning complex values to a real array

2009-12-09 Thread Dr. Phillip M. Feldman
Pauli Virtanen-3 wrote: > > I'd think that downcasting is different from dropping the imaginary part. > There are many ways (in fact, an unlimited number) to downcast from complex to real. Here are three possibilities: - Take the real part. - Take the magnitude (root-mean-square of the real

Re: [Numpy-discussion] Impossibility to build nipy on recent numpy?

2009-12-09 Thread Robert Kern
On Wed, Dec 9, 2009 at 15:40, Gael Varoquaux wrote: > On Wed, Dec 09, 2009 at 04:36:54PM -0500, Matthew Brett wrote: >> > "/home/varoquau/dev/nipy-trunk/nipy/neurospin/register/iconic_matcher.py", >> > line 6, in >> >    from routines import _joint_histogram, _similarity, >> > similarity_measures

Re: [Numpy-discussion] Impossibility to build nipy on recent numpy?

2009-12-09 Thread Gael Varoquaux
On Wed, Dec 09, 2009 at 03:39:56PM -0600, Robert Kern wrote: > > Where routines.c is a cython-generated file. I suspect that this is due > > to the recent change in the size of the struct representing numpy arrays. > > With other projects, it was sufficient to recompile the project to avoid > > thi

Re: [Numpy-discussion] General Array -> Into Index Array + Value Array of Nonzero Elements

2009-12-09 Thread Benjamin Kern
Thanks for the quick answer. I think this will help me further for the moment. Best Benjamin ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Impossibility to build nipy on recent numpy?

2009-12-09 Thread Robert Kern
On Wed, Dec 9, 2009 at 15:31, Gael Varoquaux wrote: > In the nipy project, we have cython-generated C files checked in. > With the latest numpy I get the following run-time failure: > > "/home/varoquau/dev/nipy-trunk/nipy/neurospin/register/iconic_matcher.py", > line 6, in >    from routines impo

Re: [Numpy-discussion] Impossibility to build nipy on recent numpy?

2009-12-09 Thread Gael Varoquaux
On Wed, Dec 09, 2009 at 04:36:54PM -0500, Matthew Brett wrote: > > "/home/varoquau/dev/nipy-trunk/nipy/neurospin/register/iconic_matcher.py", > > line 6, in > >    from routines import _joint_histogram, _similarity, > > similarity_measures > >  File "numpy.pxi", line 74, in nipy.neurospin.register

Re: [Numpy-discussion] Impossibility to build nipy on recent numpy?

2009-12-09 Thread Matthew Brett
Hi, On Wed, Dec 9, 2009 at 4:31 PM, Gael Varoquaux wrote: > In the nipy project, we have cython-generated C files checked in. > With the latest numpy I get the following run-time failure: > > "/home/varoquau/dev/nipy-trunk/nipy/neurospin/register/iconic_matcher.py", > line 6, in >    from routin

[Numpy-discussion] Impossibility to build nipy on recent numpy?

2009-12-09 Thread Gael Varoquaux
In the nipy project, we have cython-generated C files checked in. With the latest numpy I get the following run-time failure: "/home/varoquau/dev/nipy-trunk/nipy/neurospin/register/iconic_matcher.py", line 6, in from routines import _joint_histogram, _similarity, similarity_measures File "

Re: [Numpy-discussion] General Array -> Into Index Array + Value Array of Nonzero Elements

2009-12-09 Thread Keith Goodman
On Wed, Dec 9, 2009 at 12:02 PM, Keith Goodman wrote: > On Wed, Dec 9, 2009 at 11:29 AM, Benjamin Kern wrote: >> Hello everyone, >> >> at the moment i like to create a numpy interface to a library for numerical >> optimization. This library uses a special format to include symmetric >> matrices

Re: [Numpy-discussion] numpy distutils breaks scipy install on mac

2009-12-09 Thread Robert Kern
On Wed, Dec 9, 2009 at 14:03, Mark Sienkiewicz wrote: > Robert Kern wrote: >> On Tue, Dec 8, 2009 at 15:36, Mark Sienkiewicz wrote: >> >>> >>> ( Presumably, some other version of gfortan does accept -arch, or this >>> code wouldn't be here, right? ) >>> >> >> Right. The -arch flag was added by Ap

Re: [Numpy-discussion] numpy distutils breaks scipy install on mac

2009-12-09 Thread Mark Sienkiewicz
Robert Kern wrote: > On Tue, Dec 8, 2009 at 15:36, Mark Sienkiewicz wrote: > >> >> ( Presumably, some other version of gfortan does accept -arch, or this >> code wouldn't be here, right? ) >> > > Right. The -arch flag was added by Apple to GCC and their patch really > should be applied to

Re: [Numpy-discussion] General Array -> Into Index Array + Value Array of Nonzero Elements

2009-12-09 Thread Keith Goodman
On Wed, Dec 9, 2009 at 11:29 AM, Benjamin Kern wrote: > Hello everyone, > > at the moment i like to create a numpy interface to a library for numerical > optimization. This library uses a special format to include symmetric > matrices, basically if you have > > A = np.array([ [1.0, 0.0, 2.0] >  

[Numpy-discussion] git gui

2009-12-09 Thread Charles R Harris
There is a new git gui out. Some windows users might like to give it a try and report back. Chuck ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discu

[Numpy-discussion] General Array -> Into Index Array + Value Array of Nonzero Elements

2009-12-09 Thread Benjamin Kern
Hello everyone, at the moment i like to create a numpy interface to a library for numerical optimization. This library uses a special format to include symmetric matrices, basically if you have A = np.array([ [1.0, 0.0, 2.0] [0.0, 3.0, 0.0] [2.

Re: [Numpy-discussion] Fixed-point arithemetic...any solution yet?

2009-12-09 Thread Neal Becker
Ruben Salvador wrote: > Hello everybody. > > I've seen this question arise sometimes on the list, but don't know if > something has "happened" yet or not. I mean, any solution feasible to use > more or less right out of the box? > > I'm just a hardware engineer, so it would be difficult for me t

Re: [Numpy-discussion] Fixed-point arithemetic...any solution yet?

2009-12-09 Thread Dag Sverre Seljebotn
Ruben Salvador wrote: > Hello everybody. > > I've seen this question arise sometimes on the list, but don't know if > something has "happened" yet or not. I mean, any solution feasible to > use more or less right out of the box? > > I'm just a hardware engineer, so it would be difficult for me

Re: [Numpy-discussion] Numpy not reconising PA-RISC CPU on HP-UX workstation.

2009-12-09 Thread Charles R Harris
On Wed, Dec 9, 2009 at 12:13 PM, David Kirkby wrote: > See here for a fuller errror message, > > http://trac.sagemath.org/sage_trac/ticket/7166 > > but basically I see: > > gcc: build/src.hp-ux-B.11.11-9000-785-2.6/numpy/core/src/_sortmodule.c > In file included from numpy/core/include/numpy/npy_e

[Numpy-discussion] Numpy not reconising PA-RISC CPU on HP-UX workstation.

2009-12-09 Thread David Kirkby
See here for a fuller errror message, http://trac.sagemath.org/sage_trac/ticket/7166 but basically I see: gcc: build/src.hp-ux-B.11.11-9000-785-2.6/numpy/core/src/_sortmodule.c In file included from numpy/core/include/numpy/npy_endian.h:22, from numpy/core/include/numpy/ndarrayob

Re: [Numpy-discussion] Release blockers for 1.4.0 ?

2009-12-09 Thread Robert Kern
On Wed, Dec 9, 2009 at 01:41, Anne Archibald wrote: > 2009/12/8 Robert Kern : >>  olderr = np.seterr(divide='ignore', invalid='ignore') >>  try: >>    result = self.f(da, db, *args, **kwargs) >>  finally: >>    np.seterr(**olderr) > > Doesn't this risk a ctrl-C after the seterr but before the try

Re: [Numpy-discussion] Applying Patch #1085

2009-12-09 Thread Citi, Luca
Hello! > What do people think of applying patch #1085. Fine with me. > I'd rename the function ... Let me know if you want me to make these canges or feel free to make them. > It looks like the routine doesn't try to determine if the > views actually overlap, just if they might potentially > sha

Re: [Numpy-discussion] Assigning complex values to a real array

2009-12-09 Thread Charles R Harris
On Wed, Dec 9, 2009 at 2:04 AM, Pauli Virtanen wrote: > ti, 2009-12-08 kello 22:26 -0800, Dr. Phillip M. Feldman kirjoitti: > > Darren Dale wrote: > > > On Sat, Mar 7, 2009 at 5:18 AM, Robert Kern > wrote: > > >> On Sat, Mar 7, 2009 at 04:10, Stéfan van der Walt > > >> wrote: > > >> > 2009/3/7

Re: [Numpy-discussion] Assigning complex values to a real array

2009-12-09 Thread josef . pktd
On Wed, Dec 9, 2009 at 9:46 AM, Ryan May wrote: > On Wed, Dec 9, 2009 at 3:51 AM, David Warde-Farley > wrote: >> On 9-Dec-09, at 1:26 AM, Dr. Phillip M. Feldman wrote: >>> Unfortunately, NumPy seems to be a sort of step-child of Python, >>> tolerated, >>> but not fully accepted. There are a numb

[Numpy-discussion] Fixed-point arithemetic...any solution yet?

2009-12-09 Thread Ruben Salvador
Hello everybody. I've seen this question arise sometimes on the list, but don't know if something has "happened" yet or not. I mean, any solution feasible to use more or less right out of the box? I'm just a hardware engineer, so it would be difficult for me to create my own class for this, since

Re: [Numpy-discussion] Assigning complex values to a real array

2009-12-09 Thread Ryan May
On Wed, Dec 9, 2009 at 3:51 AM, David Warde-Farley wrote: > On 9-Dec-09, at 1:26 AM, Dr. Phillip M. Feldman wrote: >> Unfortunately, NumPy seems to be a sort of step-child of Python, >> tolerated, >> but not fully accepted. There are a number of people who continue to >> use Matlab, >> despite all

Re: [Numpy-discussion] doctest improvements patch (and possible regressions)

2009-12-09 Thread Michael Droettboom
Paul Ivanov wrote: > I marked up suspicious differences with XXX, since I don't know if > they're significant. In particular: > - shortening a defchararray by strip does not change it's dtype to a > shorter one (apparently it used to?) Yes. The new behavior is to return a string array with the sa

Re: [Numpy-discussion] slices of structured arrays?

2009-12-09 Thread Ernest Adrogué
9/12/09 @ 00:45 (-0500), thus spake josef.p...@gmail.com: > as long as all numbers are of the same type, you can create a view > that behaves (mostly) like a regular array > [...] Thanks Josef. Great explanation. It's all clear now. Ernest ___ NumPy-Di

Re: [Numpy-discussion] Bytes vs. Unicode in Python3

2009-12-09 Thread Francesc Alted
A Sunday 06 December 2009 11:47:23 Francesc Alted escrigué: > A Saturday 05 December 2009 11:16:55 Dag Sverre Seljebotn escrigué: > > > In [19]: t = np.dtype("i4,f4") > > > > > > In [20]: t > > > Out[20]: dtype([('f0', ' > > > > > In [21]: hash(t) > > > Out[21]: -9041335829180134223 > > > > > > In

Re: [Numpy-discussion] Assigning complex values to a real array

2009-12-09 Thread David Warde-Farley
On 9-Dec-09, at 1:26 AM, Dr. Phillip M. Feldman wrote: > NumPy and Python are somewhat out of step. The NumPy approach > is stricter and more likely to catch errors than Python. Python > tends to be > somewhat laissez-faire about numerical errors and the correctness of > results. The bug/quirk

Re: [Numpy-discussion] Assigning complex values to a real array

2009-12-09 Thread Dag Sverre Seljebotn
Pauli Virtanen wrote: > ti, 2009-12-08 kello 22:26 -0800, Dr. Phillip M. Feldman kirjoitti: > >> Darren Dale wrote: >> >>> On Sat, Mar 7, 2009 at 5:18 AM, Robert Kern wrote: >>> On Sat, Mar 7, 2009 at 04:10, Stéfan van der Walt wrote: > 2009/3/7 Robert K

Re: [Numpy-discussion] Assigning complex values to a real array

2009-12-09 Thread Pauli Virtanen
ti, 2009-12-08 kello 22:26 -0800, Dr. Phillip M. Feldman kirjoitti: > Darren Dale wrote: > > On Sat, Mar 7, 2009 at 5:18 AM, Robert Kern wrote: > >> On Sat, Mar 7, 2009 at 04:10, Stéfan van der Walt > >> wrote: > >> > 2009/3/7 Robert Kern : > >> >> In [5]: z = zeros(3, int) > >> >> > >> >> In [6]