lundi 4 avril 2016

How to create a random array in a certain range

Suppose I want to create a list or a numpy array of 5 elements like this:

array = [i, j, k, l, m] 

where:

  • i is in range 1.5 to 12.4
  • j is in range 0 to 5
  • k is in range 4 to 16
  • l is in range 3 to 5
  • m is in range 2.4 to 8.9.

This is an example to show that some ranges include fractions. What would be an easy way to do this?




Aucun commentaire:

Enregistrer un commentaire