469,955 Members | 2,388 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,955 developers. It's quick & easy.

Re: Taking the floating point distances and plotting histogram

aditya shukla wrote:
I have a program whose output is stored in a text file , say test.txt
eg.
0\9\10\11|0.50|c:\windows\apppatch/AcLayers.dll
0\9\10\11|0.50|c:\windows\apppatch/AcRedir.dll
0\9\10|0.66|c:\windows\apppatch/AcSpecfc.dll
0\9|0.83|c:\windows\apppatch/iebrshim.dll

After reading this text file i need to extract the float point values
from each line ie , 0.50,0.50,0.66.0.83 <http://0.66.0.83respectively
in this case, till the end of the file is reached and then i need to
plot a histogram based on these values .
Extracting is easy; you can do something like

data = []
for line in open("test.txt"):
line = line.split("|")
data.append(float(line[1]))

(or maybe use the csv module with a custom separator)

Plotting is a bit different -- there are many ways to do that, depending
on where and how you want to display that histogram (on a website, in a
window on your machine, in a PDF file, ...), but most solutions require
additional libraries. Here's one such library:

http://matplotlib.sourceforge.net/

</F>

Jul 23 '08 #1
0 890

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Oracle3001 | last post: by
9 posts views Thread by Dr. Colombes | last post: by
3 posts views Thread by bchaillou | last post: by
1 post views Thread by wayne | last post: by
27 posts views Thread by G Patel | last post: by
14 posts views Thread by amitsoni.1984 | last post: by
reply views Thread by Kurt Smith | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.