Suppose I have an array
k= array([[1, 2, 3, 4, 5],
[5, 6, 7, 8, 9],
[2, 5, 4, 7, 3],
[4, 7, 6, 8, 2],
[1, 2, 4, 3, 6],
[7, 8, 9, 5, 4]])
Assuming that after computing for each columns in an array I got array([0.6,0.4,0.75,0.2,0.75]) respectively, such that:
computation on column1 i.e. computation on array([1,5,2,4,1,7]) results in 0.6,
computation on column2 i.e. computation on array([2,6,5,7,2,8]) results in 0.4,
computation on column3 i.e. computation on array([3,7,4,6,4,9]) results in 0.75, and so on.
Let the computed list be m. such that
m=array([0.6,0.4,0.75,0.2,0.75])
So far I have computed for single columns in array k. Now I would like to group the elements in list m based on the largest floating point element in the list m and compute again on k. For example:
m[2]=m[4]=0.75 (largest number in the array), that would mean index 2 and index 4 of column in array k is largest. So keeping that index number common I would like to group k[:,2] with k[:,0],k[:,2] with k[:,1],k[:,2] with k[:,3] and similarly k[:,4] with k[:,0],k[:,4] with k[:,1],k[:,4] with k[:,3] and compute again on k,
such that grouping k[:,2] with k[:,0] means :
k0_2=array([[1,3], k1_2=array([[2,3], k3_2=array([[4,3],
[5,7], [6,7], [8,7],
[2,4], [5,4], [7,4],
[4,6], [7,6], [8,6],
[1,4], [2,4], [3,4],
[7,9]]) [8,9]]) [5,9]])
k0_4=array([[1,5], k1_4=array([[2,5], k3_4=array([[4,5],
[5,9], [6,9], [8,9],
[2,9], [5,3], [7,3],
[4,2], [7,2], [8,2],
[1,6], [2,6], [3,6],
[7,4]]) [8,4]]) [5,4]])
Can anyone please give me any clue regarding grouping column indices of array k based on max value of list m as shown above .
k"? And how do you get the groups you've described in that sentence? Could you make this a bit clearer, for example describe to us in more details the steps we would take to get these groups?mthen sure.