Jul-06-2021, 07:14 AM
I've now changed the composition of the values so that I have everything in a list. Now what I'd have to do is stack every 8th value into a column somehow, if that's possible, or create a loop to calculate the averages of every 8th value etc. The output is now this:
[['#0'], ['0.4000'], ['0.1500'], ['1.5187'], ['Fixed'], ['Fixed'], ['0.0473'], ['76.2093'], ['8.8510'], ['14.9398'], ['1.3789'], ['0.9853'], ['0.5720'], ['40.4648'], ['0.0551'], ['#1'], ['0.4000'], ['0.1500'], ['1.5094'], ['Fixed'], ['Fixed'], ['0.0450'], ['74.3954'], ['9.9777'], ['15.6269'], ['1.3704'], ['0.9724'], ['0.5760'], ['40.5128'], ['0.0545'], ['#2'], ['0.4000'], ['0.1500'], ['1.5491'], ['Fixed'], ['Fixed'], ['0.0468'], ['74.7040'], ... ['Fixed'], ['Fixed'], ['0.0536'], ['77.1376'], ['8.7556'], ['14.1069'], ['1.2754'], ['0.9602'], ['0.4889'], ['40.5042'], ['0.0548']](with this code):
my_file = open(out, "r") content = my_file.read() content_list = content.split() my_file.close() myList = content_list myList = [i.split('\n') for i in myList] del myList[0:10] print(myList)So now I'd have to calculate averages of every 8th value, as well as plot them. I suppose it's easier this way: is there a method to stack the values into columns somehow, is the only option loop over the values? Any help is greatly appreciated!