vendredi 16 octobre 2020

How would you change a float by a random amount within a range in Python?

Below is a list of float in an input file called 'inputfile' I want to loop through each float and randomise it by ± 0.100. How would I go about doing this?

 0.08777767595196
 0.41688405291929
 1.90493522025702
 -0.44512262940079
 -1.68572227053594
 -0.19769851139757
 0.61588125474274
 2.98863319423069
 -0.78312326907806
 -2.73208403405514
 -0.36006068363418



Aucun commentaire:

Enregistrer un commentaire