Hi guys! Pretty easy question below
From the code below 'data' is made by a column of numbers, let's say 12 numbers (see below)
56.71739
56.67950
56.65762
56.63320
56.61648
56.60323
56.63215
56.74365
56.98378
57.34681
57.78903
58.27959
def block_generator():
with open ('test', 'r') as lines:
data = lines.readlines ()[5::]
for line in data: # this actually gives me the
if not line.startswith (" "): # column of 12 numbers
block = # how to get blocks of 4 lines???
yield block
How can I create blocks of of four numbers? For example
56.71739
56.67950
56.65762
56.63320
56.61648
56.60323
56.63215
56.74365
and so on... because I need to process all the blocks.
Thanks for reading