With the code below, it prints the value 'phase' one by one. I am trying to print these values as an array outside of for loop.
import math
Period = 6.2
time1 = datafile1[:,0]
magnitude1 = datafile1[:,1]
for i in range(len(time1)):
print(i,time1[i])
floor = math.floor((time1[i]-time1[0])/Period)
phase = ((time1[i]-time1[0])/Period)-floor
print (phase)
It is printing like this:
0.002
0.003
0.004
0.005
I would like it to print like this:
[0.002, 0.003, 0.004, 0.005]
datafile1structure so answerers can offer working and complete code.print('[' + ', '.join(phases) + ']')