I am writing a Python program that imports 1000s of data point in blocks of 10 points at a time. From each block of 10 data points a maximum for that set is found, then the program loops to the next 10 data points and continues. All of this works fine, I just need to build an array to hold my maximum data point that are created once per loop, so I can plot it them later. How can I create this array within the loop, here is what I have:
for count in range(self.files/self.block_length):
RSS = scipy.fromfile(self.hfile2, dtype=self.datatype, count=self.block_length)
MaxRSS = np.max(RSS)#Takes the greatest value in the array of size defined by block_length
Here MaxRSS works great to save to file or print to screen, as the program loops; however, at the end of the loop it only holds the last value and I need something to hold all of the Max values found
[scipy.fromfile(self.hfile2, dtype=self.datatype, count=self.block_length).max() for count in range(self.files/self.block_length)]