I repeat the numpy array to apply the function through each element and add a new value to the list to preserve the original data.
The problem is that it is slow.
Is there a better way to do this (without changing the original array)?
import numpy as np
original_data = np.arange(0,16000, dtype = np.float32)
new_data = [i/max(original_data) for i in original_data]
print('done')
source
share