[Tutor] import data (txt/csv) into list/array and manipulation

trias t.gkikopoulos at dundee.ac.uk
Thu Nov 20 12:43:03 CET 2008


 so for this part of the problem it goes a bit like this:

 I have a CSV file (file1) that contains three columns, column one contains
a unique ID type str,
columns two and three contain start and stop coordinates type int. 
  the other file (file2) contains two columns, column one contains a single
coordinate type int and the second column contains a value type float.

 What I would like to do is for example be able to grab the values from
file2 that lies within range defind by the start,stop coordinates associated
with an ID from file1.

  But most importantly I would like to be able to grab say the values from
file1 that are from range((start-300),start) for every single ID in file1, I
guess plot them in an array and then calculate the sum/ of these values and
plot them, ie for ob1 in file get values from range((1025-300),1025), for
ob2((1090-300),1090) for ob3((2200-300),2200) and then plot/calculate the
sum assuming the have the same start coordinate, so x axis would be (step)
values from 0-300 and y axis would be the sum of values from ob1,2,3 for
every single step value from 0-300.

 does this make sense/

cheers http://www.nabble.com/file/p20599488/file1.csv file1.csv 
http://www.nabble.com/file/p20599488/file2.csv file2.csv 

Kent Johnson wrote:
> On Thu, Nov 13, 2008 at 9:50 AM, trias <t.gkikopoulos at dundee.ac.uk> wrote:
>> PS I could maybe upload a couple of small example flies or a schematic to
>> see what I mean
> A small example would be very helpful. Also please subscribe to the list.
> Kent
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor

View this message in context: http://www.nabble.com/import-data-%28txt-csv%29-into-list-array-and-manipulation-tp20424075p20599488.html
Sent from the Python - tutor mailing list archive at Nabble.com.

More information about the Tutor mailing list