I'm trying to get a "pythonic" way or using a library (anything except "for" loops) for doing this.
my_array = np.array([2,4,6])
my_array[[0,2,0]] = my_array[[0,2,0]] * 2
Expected result:
[8,4,12]
However, I get:
[4,4,12]
This doesn't work for me as I need to multiply twice the factor (2) for the position 0 if, through the index, the 0 position repeats n amount of times.
"For" loops can't be used as there are billions of data points