0

Write NumPy program to generate six random integers between 10 and 30

Python program

19th Mar 2020, 3:31 PM
Gauri Tajane
Gauri Tajane - avatar
5 Antworten
+ 4
Please post you code here.
19th Mar 2020, 3:35 PM
Pedro H.J
Pedro H.J - avatar
+ 2
Gauri Tajane have you attempted this task if yes show your attempt, community might try to answer and correct your mistakes , we aren't here to provide codes
19th Mar 2020, 3:43 PM
Daljeet Singh
Daljeet Singh - avatar
+ 1
import numpy as np x=np.random.randint(low=10,high=30,size=6) print(x)
19th Mar 2020, 4:14 PM
Gauri Tajane
Gauri Tajane - avatar
0
Gauri Tajane from so: from numpy.random import default_rng rng = default_rng() numbers = rng.choice(30, size=6,replace=False) print(numbers) https://numpy.org/doc/1.17/reference/random/generated/numpy.random.Generator.choice.html so link: https://stackoverflow.com/questions/8505651/non-repetitive-random-number-in-numpy
21st Mar 2020, 8:21 AM
Daljeet Singh
Daljeet Singh - avatar
- 1
I want code...
19th Mar 2020, 3:37 PM
Gauri Tajane
Gauri Tajane - avatar