• Register

Ali obstaja takšna funkcija, ki izbere več naključnih decimalnih števil na nekem intervalu ?

+3 votes
106 views
asked Dec 28, 2015 by strojnik (270 points)
retagged Dec 29, 2015 by Marko Mihalec

2 Answers

+3 votes
 
Best answer
Funkcija

np.random.uniform(1.5, 5.5, 10)

vrne več decimalnih števil (10) na intervalu med (1.5) in (5.5).
answered Dec 28, 2015 by zanpirc (1,200 points)
selected Jan 2, 2016 by blaz
+2 votes
Druga možnost bi bila, da bi uporabil znano funkcijo np.random.rand() jo pomnožil (razširil interval) in mu prištel neko število (premaknil interval). Primer: np.random.rand(10)*4+1.5
answered Dec 28, 2015 by domsin (350 points)
edited Dec 29, 2015 by domsin
...