You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
simulacion-permeabilidad/fftma_module/gen/parse_array.py

25 lines
634 B
Python

import collections
def parse_array():
with open("log_16-aa") as log_file:
# rearrange data
lines_parsed = []
lines = log_file.readlines()
for line in lines:
if "iv[0]" in line:
line_splitted = line.split()[2::3]
lines_parsed.append(line_splitted)
# create histogram
histogram = {}
for i in range(len(lines_parsed)):
for j in range(len(lines_parsed[i])):
histogram[j] = histogram.get(j, [])
histogram[j].append(lines_parsed[i][j])
# iterate histogram
for position, values in histogram.items():
print(collections.Counter(values))
parse_array()