I managed to open .txt files without uploading them first. The spaces in 
your directory names could cause problems, but I'm guessing here. On my 
mac, I did:

pathname = 
'/Users/sschym/Documents/papers/WRR_budyko/data/CT45bigleafmultisoil8n_12_scl_30yr/'
data = numpy.loadtxt(pathname + 'yearly.txt',dtype='S17')

and it worked.
Try it step by step to see where the error occurs. You could also try:

fname = pathname + 'base.txt'
fh = file(fname)
first_row = fh.readline()

If fh = filen(fname) returns an error, then there is likely a problem 
with the path. Otherwise, if first_row contains the first line of your 
base.txt file, the import is not the problem.

Stan

William Stein wrote:
> On Tue, Apr 7, 2009 at 8:30 PM, hou.andrew <[email protected]> wrote:
>   
>> 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?
>>
>>     
>
> You must upload your data to the notebook first using
>
>    Data --> Upload or Create File...
>
>
>
> 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