[Tutor] Matching relational data

David Hutto smokefloat at gmail.com
Mon Oct 4 17:04:09 CEST 2010

Thanks for your replies, and reminding me of statistics(probably a
quick crash course).
The data I plan to use would be equally charted by a constant timestep
in it's movement(type of movement
graphed being dictated by the object being measured)

So I thought that maybe the easiest way would be something like the following:

a = ['+','-','+','-','+','-','+','-','+','-','+']
b = ['-','+','-','+','-','-','-','+','-','-','-']

count = 0
lena = len(a)
lenb = len(b)
if lena == lenb:
	for num in range(0,lena):
		if a[num] == b[num]:
			print 'match'
			count += 1
	print 'Lists are not same length for comparison'
per = (100/lena)
print count * per, '% match'

The plus and minus signs would represent the movement over an equal
amount of time(say one minute/hour)
Although I'm going to the statistics for the rest of this, anyone who
has an improved solution let me know.


More information about the Tutor mailing list