MCD wrote:
I've mostly been racking my brain with this bit of code:
newtm = ((klock + 4) // 5 * 5 ) % 2400
You might want to take another look at the first reply I sent you: it contains a
function that does this:
def groupkey(data):
"""Groups times by 5 min resolution. Note this version does
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
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 == :
MCD wrote:
Hi Michael, thanks for responding. I actually don't use a method to get
each bin...
That's because you picked the wrong suggestion ;-) No, seriously, you can do it
easily with this approach:
the bin outputs are nested in the loop. Here's my code:
data_file = open('G:\file.txt')
DUMM
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
MCD wrote:
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 every
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
MCD wrote:
> This goes on throughout a 12hr. period. I'd like to be able to place
> the low and high values of the additional fields in a single line
> divided into 5min intervals. So it would look something like this >>
>
> 1235 22 88
> 1240 31 94
what about a sane list comprehension madness ?
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
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
On 19 Mar 2005 19:01:05 -0800, "MCD" <[EMAIL PROTECTED]> wrote:
>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.
Are you (extremely) new to computer programming? Is this school
hom
MCD wrote:
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
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
13 matches
Mail list logo