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

hou.andrew wrote:
> Good Afternoon, Prof. Stein
>
> In an effort to move away from a program in which I either have to be
> present in a computer lab or buy, I am attempting to use Sage instead
> of MATLAB for my Bioengineering class where I have to analyze data
> acquired from an EMG. I have a waveform of time vs. voltage saved to
> a .txt file. How do I load a .txt file for use as a variable in Sage,
> and is there a built in function for computing the Root Mean Squared
> value?
>
> Thanks,
>
> ~Andrew
>
> >
>   


--~--~---------~--~----~------------~-------~--~----~
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