Re: Building Time Based Bins

2005-03-22 Thread MCD
Michael Spencer wrote: > (BTW, there must be more to your code than you have shared for the above line to > execute without raising an exception - where are 'time' and 'a' initially bound? > BTW2, 'time' is the name of a stdlib module, so it's bad practice to use it as > an identifier) Yes there

Re: Building Time Based Bins

2005-03-22 Thread MCD
Ok, thanks Michael, I got it sorted out now. It was just a question of placing the append statement and the new list in the right place. I also added a delete command so the list doesn't become too huge, especially when there's no need to keep it. Here's the corrected code: if bintm == :

Re: Building Time Based Bins

2005-03-21 Thread MCD
Hi Michael, thanks for responding. I actually don't use a method to get each bin... the bin outputs are nested in the loop. Here's my code: data_file = open('G:\file.txt') DUMMY = bintm = DUMMY for line in data_file: fields = line.strip().split() if not line: continue ilist = [int

Re: Building Time Based Bins

2005-03-21 Thread MCD
Thanks Alessandro... I'll have to try that as well. I have a modified working version of John's code (thanks John!). I'm able to output the bins by 5min intervals, sum one of the fields, and get the high and low of each field. So far I'm really happy with how it works. Thank you to everybody. The

Re: Building Time Based Bins

2005-03-20 Thread MCD
Never mind about the summing... I learned that you can do this: sumhi = 0 sumhi += hi Cool! Thanks again. -- http://mail.python.org/mailman/listinfo/python-list

Re: Building Time Based Bins

2005-03-20 Thread MCD
John Machin wrote: > Are you (extremely) new to computer programming? Is this school > homework? Lol, yes, I am relatively new to programming... and very new to python. I have experience working with loops, if thens, and boolean operations, but I haven't worked with lists or array's as of yet... s

Building Time Based Bins

2005-03-19 Thread MCD
Hello, I'm new to python and this group and am trying to build some bins and was wondering if any of you could kindly help me out. I'm a bit lost on how to begin. I have some text files that have a time filed along with 2 other fields formatted like this >> 1231 23 56 1232 25 79 1234 26 88 1235 2