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
Hi,
You can try masked_array module:
x = np.array([[0,1,2],[3,4,5],[6,7,8]])
I3 np.ma.masked_where(x<1, 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 sma
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, Tru
On Wed, Mar 14, 2012 at 9:25 AM, Pauli Virtanen 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 who know
wh
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 sti
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 and
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 Gohlke wrote:
>>>
>>> On 3/9/2012 11:50 AM, Sameer Grover wrote:
>>> import gtk
>>> import foo # where foo is any f2py-wrapped program
Subsequ