how to load data and store the data from a file using numpy

Posted by Charlie Epps on Stack Overflow See other posts from Stack Overflow or by Charlie Epps
Published on 2010-03-07T08:52:21Z Indexed on 2010/03/08 17:06 UTC
Read the original article Hit count: 219

Filed under:
|
|

I have the following file like this:

2 qid:1 1:0.32 2:0.50 3:0.78 4:0.02 10:0.90
5 qid:2 2:0.22 5:0.34 6:0.87 10:0.56 12:0.32 19:0.24 20:0.55
...

he structure is follwoing like that:

output={} rel=2 qid=1 features={} # the feature list "1:0.32 2:0.50 3:0.78 4:0.02 10:0.90" output.append([rel,qid,features]) ... How can I write my python code to load the data, thanks

© Stack Overflow or respective owner

Related posts about python

Related posts about numpy