I have a set of arrays within a larger array, for example:
[[0,1,2,3,4],[5,6,7,8,9],[10,11,12,13,14],[15,16,17,18,19],[20,21,22,23,24]]
I need to normalise each array separately within the larger array. Here is what I have so far, which is creating the smaller arrays within the larger array:
small_array_size = 5
large_array_size = small_array_size**2
large_list = list(results)
small_lists = [[large_list[i*small_array_size+j] for i in range(small_array_size)]
for j in range(small_array_size)]
This works and gives me the correct values in each array. The next step is the bit which is giving me trouble - normalising each small array separately. This is what I have, which works fine for the first group:
group_1 = small_lists[0]
normalised = [(group_1[i]-min(group_1))/(max(group_1)-min(group_1)) for i in range(small_array_size)]
How can I modify this to repeat for every array in small_lists?
question from:
https://stackoverflow.com/questions/66049877/normalise-arrays-within-array 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…