mku wrote:
> Hi,
>
> thereĀ“s a function inside a module. How can these function retrieve
> the path+name of his module ? (The path is most important).
> That should also work if the module is part of a package.
>
> Thanks in advance
>
> Martin
>
Try the following in the function:
import tra
> With the new numeric, you'll be able to do:
>
> negatives = a[a<0]
>
> Cheers,
>
> f
>
Ooh, that's nice.
Jim
--
http://mail.python.org/mailman/listinfo/python-list
>
> new = Numeric.compress(Numeric.less(a,0),a)
Ah, thank you!
Sorry about subject mangle, I gave a silly example first time round.
Jim
--
http://mail.python.org/mailman/listinfo/python-list
Hi all
I have an array a=array([2,3,-1]).
I want to extract an array with all the elements of a that are less than 0.
Method 1.
new = array([i for i in a if i < 0])
Method 2.
new = a[nonzero(a<0)]
I'm using Numeric arrays but can't seem to find a function that does this.
Am I missing a more o
Hi all
I have an array a=array([2,3,1]).
I want to extract an array with all the elements of a that are less than 0.
Method 1.
new = array([i for i in a if i < 0])
Method 2.
new = a[nonzero(a<0)]
I'm using Numeric arrays but can't seem to find a function that does this.
Am I missing a more ob
> reading this may help:
>
> http://effbot.org/zone/python-objects.htm
>
>
>
>
>
site bookmarked ;)
--
http://mail.python.org/mailman/listinfo/python-list
> trust me, it works the same way for all objects.
>
>
Yes, it was lack of trust that led me on a 2 hour re-write to avoid
creating subsets of object lists as I thought they were being copied. In
fact it was another error... huh.
I now know better.
Jim
--
http://mail.python.org/mailman/lis
Hi everyone
Was just posting a question as I got confused with a big messy sheaf of
code when I thought I should make a simple example myself. Since I did I
thought I'd post it for the good of mankind.
I was confused as to whether the assignment of a result of a list
comprehension created refe