On Tue, Apr 7, 2009 at 5:13 AM, Stan Schymanski <[email protected]> wrote:
>
> Dear Andrew,
>
> Perhaps this may help:
>
> sage: import numpy
> sage: metdata = numpy.loadtxt(pathname + 'filename.txt',dtype='S17')
>
> where pathname is a text string with the path to the file and
> 'filename.txt' needs to be replaced with the file name.
>
> dtype='S17' means that you expect up to 17 characters of data in each
> column. This will read your file as a numpy array containing text. You
> can then examine the file and re-import it with the proper dtype option
> to read it in as e.g. floats. After 'import numpy', you can simply write
> numpy.loadtxt? to find out about the other options. Numpy also provides
> all sorts of useful data analysis tools. Find out about them by typing
> numpy. and <Tab> in the notebook.
>
> Good luck!
>
> Stan

Also, the std method on a numpy array will give you the root mean
square.  See, e.g., this page:

http://www.hjcb.nl/python/Arrays.html

William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to