parsedata.py
This commit is contained in:
parent
3871bf7829
commit
f27bb51086
|
@ -0,0 +1 @@
|
|||
__pycache__
|
|
@ -0,0 +1,19 @@
|
|||
import os, numpy as np
|
||||
|
||||
f = open("data.txt", "r").readlines()
|
||||
|
||||
# create a numpy array of the data
|
||||
data = np.zeros((len(f), 2))
|
||||
for i in range(len(f)):
|
||||
# get the last two columns of the data, then convert them to numpy integers, and place it into the array
|
||||
data[i] = np.array(f[i].strip().split(",")[-2:], dtype=np.int32)
|
||||
|
||||
# sum each index of the array
|
||||
sum = np.sum(data, axis=1)
|
||||
|
||||
count = 0
|
||||
for i in sum:
|
||||
# print(count, i)
|
||||
# convert each i in pico seconds to MHz
|
||||
print(count, (1/(i*10**-12))/10**6)
|
||||
count += 1
|
Loading…
Reference in New Issue