Using numpy.argmax() on multidimensional arrays

前端 未结 2 1354
孤街浪徒
孤街浪徒 2020-12-31 08:37

I have a 4 dimensional array, i.e., data.shape = (20,30,33,288). I am finding the index of the closest array to n using

index = abs(data - n).a         


        
2条回答
  •  时光说笑
    2020-12-31 09:16

    If I understood you correctly, this should work:

    numpy.put(data, index, values)
    

    I learned something new today, thanks.

提交回复
热议问题