[Tutor] indexing a list
s.charonis at gmail.com
Thu Oct 18 14:01:59 CEST 2012
I have a string that I want to read in fixed-length windows.
In : SEQ
I would like a function that reads the above string, 21 characters at a
time, and checks for certain conditions, i.e. whether characters co-occur
in other lists I have made. For example:
x = 21 # WINDOW LENGTH
In : SEQ[0:x]
In : SEQ[x:2*x]
In : SEQ[2*x:3*x]
How could I write a function to automate this so that it does this from
SEQ throughout the entire sequence, i.e. until len(SEQ)?
Many thanks for your time,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor