Re: [Tutor] Confused about "import Numeric" vs "import numpy" for Arrays

2008-08-08 Thread S Python
> Another reason not to use "from xx import *" is that it can make it > very difficult to discover where a name is defined. If you have > several "from xx import *" lines and then later you use a function > "foo()" there is no easy way to tell which module foo came from. > > An alternative is to li

Re: [Tutor] Confused about "import Numeric" vs "import numpy" forArrays

2008-08-08 Thread S Python
> A useful tip is that if you have a long module name you can also use > > import module as shortname > > eg > > import numpy as n > > and then access numpy.foo() as > > n.foo() > > Sacves a lot of typing for a slight loss of clarity in > maintenance - you have to remember which module the > short

Re: [Tutor] Confused about "import Numeric" vs "import numpy" for Arrays

2008-08-08 Thread S Python
> In general "from import *" is a very bad idea. > > import imports a module into its own namespace (e.g., to > access its functionality you would have to do ".foo() and > .bar()" The form that you chose to use imports all of a > module's contents into the current namespace. This means you can ca

Re: [Tutor] Confused about "import Numeric" vs "import numpy" for Arrays

2008-08-08 Thread S Python
> No, they are not the same. Numeric is older; NumArray is another older > package. You should use Numpy if you can. > http://numpy.scipy.org/#older_array > > > Now you should be able to import numpy. > > Kent > Thanks, Kent. I ended up using: >>> from numpy import * I wasn't sure what the diff

[Tutor] Confused about "import Numeric" vs "import numpy" for Arrays

2008-08-08 Thread S Python
Hi Everyone, I would like to create a two-dimensional array but am confused as to how to go about it. I've read about Numeric Python and Numpy. Are they one and the same? Also, how do I install them? I am working on a Windows machine. I've been getting the following error messages: >>> import

Re: [Tutor] Reading List from File

2008-07-31 Thread S Python
t; > -- Forwarded message -- > From: Emile van Sebille <[EMAIL PROTECTED]> > To: tutor@python.org > Date: Thu, 31 Jul 2008 11:34:56 -0700 > Subject: Re: [Tutor] Reading List from File > S Python wrote: >>>>> >>>>> f = open(r'C:\

Re: [Tutor] Reading List from File

2008-07-31 Thread S Python
On Thu, Jul 31, 2008 at 2:20 PM, Monika Jisswel <[EMAIL PROTECTED]> wrote: > oops it is reader not Reader (all lower case), so this line : data = > csv.Reader(myfile, delimeter = ',') > should be data = csv.reader(myfile, delimeter = ',') > > > 2008/7

Re: [Tutor] Reading List from File

2008-07-31 Thread S Python
Hi Everyone, Thanks for the variety of responses in such a short amount of time. This distribution list is incredible. Sorry for the delayed reply as I wanted to test what everyone suggested, so here goes: --- @Amin: I tried your suggestion, but perhaps I don't unde

[Tutor] Reading List from File

2008-07-31 Thread S Python
Hi Everyone, I am trying to read a comma-delimitted list ("aaa","bbb","ccc") from a text file and assign those values to a list, x, such that: x = ["aaa", "bbb", "ccc"] The code that I have come up with looks like this: >>> x = [] >>> f = open(r'c:\test.txt', 'r') >>> x.extend(f.readlines()) >>

Re: [Tutor] (no subject)

2008-07-29 Thread S Python
Hi Morgan, Have you installed Python on your computer? If you are using Microsoft Windows, you can download and install Python from here: http://python.org/download/releases/2.5.2/ and select "python-2.5.2.msi". Once it's installed, you should have a directory on your machine called "C:\python25