I tried import numpy metdata = numpy.loadtxt('C:\Users\Andrew\Documents\BIOEN 301\Lab 1\AH \' + 'base.txt',dtype='S17') metdata.std(axis=None, dtype=None)
Syntax error? ~Andrew On Apr 7, 4:49 pm, William Stein <wst...@gmail.com> wrote: > On Tue, Apr 7, 2009 at 5:13 AM, Stan Schymanski <schym...@gmail.com> 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 sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---