Re: [Numpy-discussion] Import NumPy in Self-defined function script

2009-02-23 Thread Tim
téfan van der Walt wrote: From: Stéfan van der Walt Subject: Re: [Numpy-discussion] Import NumPy in Self-defined function script To: "Discussion of Numerical Python" Date: Sunday, February 22, 2009, 6:45 PM Hi Tim 2009/2/23 Tim : > I think zeros belongs to Module numpy, and

Re: [Numpy-discussion] Import NumPy in Self-defined function script

2009-02-22 Thread Markus Rosenstihl
Am 23.02.2009 um 00:59 schrieb Stéfan van der Walt: > 2009/2/23 Markus Rosenstihl darmstadt.de>: >>> Another script "controller.py" calls this function as: >>> >>> [code]#! /usr/bin/env python >>> # from numpy import * >>^ This is a comment, you are not importing numpy! > > But he is also not

Re: [Numpy-discussion] Import NumPy in Self-defined function script

2009-02-22 Thread Stéfan van der Walt
2009/2/23 Markus Rosenstihl : >> Another script "controller.py" calls this function as: >> >> [code]#! /usr/bin/env python >> # from numpy import * > ^ This is a comment, you are not importing numpy! But he is also not using numpy in controller. Cheers Stéfan _

Re: [Numpy-discussion] Import NumPy in Self-defined function script

2009-02-22 Thread Gael Varoquaux
On Mon, Feb 23, 2009 at 12:47:41AM +0100, Markus Rosenstihl wrote: You are definitely right with your suggestion not to use 'from foo import *' It took me a while to realise that the gain of explicite namespace was more than the cost of a few characters, but I definitely stand by this. > I always

Re: [Numpy-discussion] Import NumPy in Self-defined function script

2009-02-22 Thread Markus Rosenstihl
Am 23.02.2009 um 00:19 schrieb Tim: > Hi, > I am defining a function in file "trainer.py". It requires a module > called numpy as following: > > > Another script "controller.py" calls this function as: > > [code]#! /usr/bin/env python > # from numpy import * ^ This is a comment, you are no

Re: [Numpy-discussion] Import NumPy in Self-defined function script

2009-02-22 Thread Stéfan van der Walt
Hi Tim 2009/2/23 Tim : > I think zeros belongs to Module numpy, and I import it in my function file > "trainer.py". So I was wonering what's the mistake I am making? Thanks for > help! What is the output of the following (please execute this inside Python inside trainer.py's directory): import

[Numpy-discussion] Import NumPy in Self-defined function script

2009-02-22 Thread Tim
Hi, I am defining a function in file "trainer.py". It requires a module called numpy as following: [code] from numpy import * import string def trainer(train_seqs):     nul_dict = {"A":0,"C":1,"G":2,"T":3}# nucleotide to index of array     init_prob = zeros(4,double)# initial prob at  1st col