Generate random array of floats between a range

前端 未结 8 1774
孤独总比滥情好
孤独总比滥情好 2020-12-02 15:04

I haven\'t been able to find a function to generate an array of random floats of a given length between a certain range.

I\'ve looked at Random sampling but no funct

8条回答
  •  时光取名叫无心
    2020-12-02 15:50

    Alternatively you could use SciPy

    from scipy import stats
    stats.uniform(0.5, 13.3).rvs(50)
    

    and for the record to sample integers it's

    stats.randint(10, 20).rvs(50)
    

提交回复
热议问题