Q:

Write a NumPy program to create a vector of length 10 with values ​​evenly distributed between 5 and 50

0

Write a NumPy program to create a vector of length 10 with values ​​evenly distributed between 5 and 50.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import numpy as np
v = np.linspace(10, 49, 5)
print("Length 10 with values evenly distributed between 5 and 50:")
print(v)

Sample Output:

Length 10 with values evenly distributed between 5 and 50:
[ 10.    19.75  29.5   39.25  49.  ]

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now