I need help with graphs in python (

Thomas Bach thbach at students.uni-mainz.de
Tue Dec 18 13:20:25 CET 2012


Most of the tasks you have to do can be achieved quite easily with the
standard library (except the plotting).

On Tue, Dec 18, 2012 at 03:29:49AM -0800, hevymetl07 at gmail.com wrote:
> These are some steps I need to do first before creating the graph:
> - Get the name of a CSV file from an ini file,
Have a look at the ConfigParser module[1],

> - Next, read a line from this CSV file,
well, the csv module[2] apparently is a good choice for that,

> - Increase a variable depending on the Log level (information,
> - warning, error, critical),
you maybe want to use collections.counter for that[3]. Anyways, I
think matplotlib can handle the counting for you…

> - Read the next line,
this is just iteration over the csv instance you created with your file

> - Then I need to print these results in a Graph.
I use matplotlib for this purpose, have a look at their gallery[4] to
decide what kind of plot best fits your needs.

I'd recommend to install ipython and start playing around with the
modules I just told you. If you are stuck somewhere read the
documentation properly (it's actually all in there) and come back
again if you cannot come up with a solution.

Hope this helps,
     Thomas Bach.

[1]  http://docs.python.org/2/library/configparser.html

[2]  http://docs.python.org/2/library/csv.html

[3]  http://docs.python.org/2/library/collections.html#collections.Counter

[4]  http://matplotlib.org/gallery.html

More information about the Python-list mailing list