Re: [Numpy-discussion] f2py and pygtk on windows

2012-03-14 Thread Sameer Grover
On Monday 12 March 2012 12:26 AM, Christoph Gohlke wrote: On 3/10/2012 9:31 PM, Sameer Grover wrote: On 10 March 2012 02:23, Christoph Gohlkecgoh...@uci.edu wrote: On 3/9/2012 11:50 AM, Sameer Grover wrote: import gtk import foo # where foo is any f2py-wrapped program Subsequently, on

[Numpy-discussion] Recovering from a STOP ?

2012-03-14 Thread Pierre GM
THYC Dear all, I'm working with some large inherited F90 code that needs to be wrapped in Python. if the code base itself cannot be modified (it's a static archive), some additional F90 files were written to help the interaction with the code. Writing a python extension combining the archive

Re: [Numpy-discussion] Recovering from a STOP ?

2012-03-14 Thread Pauli Virtanen
14.03.2012 14:28, Pierre GM kirjoitti: [clip] Alas, the RuntimeError doesn't look like it's passed back to the interpreter, which still crashes. (Adding a Py_Exit(-1) at the end of pyraise_runtime at least let the interpreter do some extra cleaning after the fortran code stopped, but

Re: [Numpy-discussion] Recovering from a STOP ?

2012-03-14 Thread Chris Barker
On Wed, Mar 14, 2012 at 9:25 AM, Pauli Virtanen p...@iki.fi wrote: Or, maybe the whole Fortran stuff can be run in a separate process, so that crashing doesn't matter. That's what I was going to suggest -- even if you can get it not to crash, it may well be in a bad state -- memory leaks, and

[Numpy-discussion] Re place array values

2012-03-14 Thread jonasr
Hello, my problem is that i want to remove some small numbers of an 2d array, for example if i want to sort out all numbers smaller then 1 of an array i get x=[[0,1,2],[3,4,5][6,7,8]] c=x=1 In [213]: c Out[213]: array([[False, True, True], [ True, True, True], [ True,

Re: [Numpy-discussion] Re place array values

2012-03-14 Thread Gökhan Sever
Hi, You can try masked_array module: x = np.array([[0,1,2],[3,4,5],[6,7,8]]) I3 np.ma.masked_where(x1, x) O3 masked_array(data = [[-- 1 2] [3 4 5] [6 7 8]], mask = [[ True False False] [False False False] [False False False]], fill_value = 99) There might be a

Re: [Numpy-discussion] Re place array values

2012-03-14 Thread Derek Ashley Thomas
Hi, I'm completely new to this list (and fairly new to numpy in general), but I was wondering if you tried multiplying the bool array and the original array. Try: x=array([[0,1,2],[3,4,5],[6,7,8]]) if rank(x) = 1 dot(x=1, x) else (x=1)*x This will give you a completely numerical array of