You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
742 B

import json
import pandas as pd
def analsis(rf, csvf):
df = pd.read_csv(csvf)
#print(df)
with open(rf, 'r', encoding='utf-8') as f:
result = json.load(f)
print(len(result))
for i in range(2, len(result)):
print(result[i][1:])
print(f'node2 receive {df.iloc[2*i-2, 28]}, err {df.iloc[2*i-2, 18]};' +
f' node4 receive {df.iloc[2*i-2, 56]},err {df.iloc[2*i-2, 46]}')
print(f'node2 receive {df.iloc[2 * i - 1, 28]}, err {df.iloc[2 * i - 1, 18]};' +
f' node4 receive {df.iloc[2 * i - 1, 56]},err {df.iloc[2 * i - 1, 46]}')
if __name__ == '__main__':
rf = '20220930-09_11'
csvf = '20220930-09_11-00-r.csv'
analsis(rf, csvf)