HMasterSunday
HMasterSunday t1_iw9allv wrote
Reply to comment by sckuzzle in Making a model predict on the basis of a particular value by ole72444
also: numpy.split can create several cuts off of a numpy array so it simplifies to:
import numpy as np def process_data(input_array): cut_array = numpy.split(input_array, (len(array)/4)) max_array =[ ] for cut in cut_array: max_array.append(max(cut)) return max_array
much shorter, used this method recently so it's on the front of my mind
edit: don't know how to format on here, sorry
HMasterSunday t1_iw9qr8l wrote
Reply to comment by sckuzzle in Making a model predict on the basis of a particular value by ole72444
Interesting, I didn't try a test run to time both approaches, I'll do that more often. As per your other point though, my code does account for that already, the number of individual cuts is 1/4 of the length of the full array (len(input_array)/4) so it splits it up into arrays of length 4 anyways. That much I do know at least.