read a table and make a basic plot

metal.suomi at gmail.com metal.suomi at gmail.com
Mon Dec 19 01:21:54 EST 2016


Hi, I'm learning python and full of extensive tutorials around. Getting a bit lost and overflowed in my head with tuples, dictionaries, lists, etc ... etc... Everything great, but I'd like to perform some basic task while learning the rest. For example, I'm having a hard time to find some practical info to get me up to speed. E.g. doing the following list of tasks:

- read a file named 'data.dat' (let's suppose it has 13 columns and n lines) and read column 3 and 4

-plot column 3 vs column 4

-write a file 'outcome.txt' which has column 3 and 4

How do I do read and write of files? Is there some extra library I need for doing plots? I have read about  matplotlib.pyplot. How can I do the plot above using this library? (running python3.5 in OSX).

Thanks!
J.


More information about the Python-list mailing list