On 29.11.2012, at 1:21AM, Robert Love wrote:

> I have a file with thousands of lines like this:
> 
> Signal was returned in 204 microseconds
> Signal was returned in 184 microseconds
> Signal was returned in 199 microseconds
> Signal was returned in 4274 microseconds
> Signal was returned in 202 microseconds
> Signal was returned in 189 microseconds
> 
> I try to read it like this:
> 
> 
> data = np.loadtxt('dummy.data', dtype={'names':('label','times','musec'), 
> 'fmts':('|S23','i8','|S13')})
> 
> It fails, I think, because it wants a string format and field for each of the 
> words 'Signal' 'was' 'returned' etc.
> 
> Can I make it treat that whole string before the number as one string, one 
> field?  All I really care about is the numbers anyway.
> 
Then how about 

np.loadtxt('dummy.data', usecols=(4, ))

Cheers,
                                        Derek

_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to