Hi,

if I use comments and the last character in the file is not space or \n then 
the last value is not returned by mlab.py's load method, due to a bug in the 
comment stripping (index returns -1 if no comment is found).

If the for loop is changed to the following, it works again:

for i,line in enumerate(fh):
        if i<skiprows: continue
        commentIdx = line.find(comments) #
        if commentIdx!=-1: #
            line = line[:commentIdx].strip() #
        if not len(line): continue
        if usecols is not None:
            vals = line.split(delimiter)
            row = [converters.get(i,float)(vals[i]) for i in usecols]
        else:
            row = [converters.get(j,float)(val) for j,val in 
enumerate(line.split(delimiter))]
        thisLen = len(row)
        X.append(row)

Lines ending with # are changed/added

Have fun,
wr

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to