[Tutor] accessing data in a usable format
John Fouhy
john at fouhy.net
Thu Oct 18 05:05:38 CEST 2007
On 18/10/2007, Bryan Fodness <bryan.fodness at gmail.com> wrote:
> I have a data file 'data1.dat',
>
> a b c d
>
> 1 0.1 0.11 0.111
> 2 0.2 0.22 0.222
> 3 0.3 0.33 0.333
>
> 9 0.9 0.99 0.999
>
> and I want to be able to access the values of b, c, or d depending on a
> value of a.
Hi Bryan,
Hve a look at the tutorial (on python.org) section on reading from
files. You'll also need to read about string methods in the standard
library (specifically, the split() method) and dictionaries (in the
tutorial, again).
If you get stuck, show us what you've tried and we'll try to help.
--
John.
More information about the Tutor
mailing list