mercredi 27 mars 2019

Generate list of floats where each number is inferior to the number of another list of floats

I am using the following code to get a random list of floats:

random_A = np.random.uniform(low=0, high=10, size=(50,))

So I get a list of 50 floats

[0.35664866 4.76750599 2.05083389 9.53811567 5.36920383 8.91679955
 2.19965617 2.62523134 6.55224616 9.35766331 5.79652488 4.23194067
 2.72168337 5.31431884 8.3975979  9.29497168 5.42797236 5.64302212
 2.91821098 5.06305922 1.88212402 0.24593891 9.45021432 0.95423611
 9.36860165 2.46100709 3.80709829 1.08442665 3.28513088 9.75743916
 5.36187267 4.61001088 0.17912406 6.52406152 3.26927165 4.40187936
 6.79600876 8.10418648 1.06927133 5.3087785  1.85829928 2.20111922
 1.6910625  6.25714944 0.29338196 5.73195802 0.73971446 3.62506435
 9.0166149  3.90316395]

What I would like to get now is another list of 50 floats let us call it random_B where each float of that list is inferior to the number compared in the first list (random_A). Could you please help me?

Regards




Aucun commentaire:

Enregistrer un commentaire