Someone on this platform has already helped me with generating the following code:
col,row = (100,1000)
a = np.random.uniform(0,10,size=col*row).round(6).reshape(row,col)
mask = (a*1e6+1).astype(int)%10<2
a[mask] += 2e-6
This code ensures that the last decimal is not a 0 or a 9. However, I would like to have no 0's nor 9's in all the decimals that are generated (such that it will not be possible to have a number 1.963749 or 3.459007).
It would be fine for all 0's and 9's to be, for example, replaced by a 2 (1.263742 and 3.452227 considering the example above). I know that the function replace (0, 2) does not work for the decimal numbers. Is there a way to replace these numbers or should the code be rewritten to make this work?