Q:

Write a NumPy program to create a vector of size 10 with values ranging from 0 to 1, both excluded

0

Write a NumPy program to create a vector of size 10 with values ranging from 0 to 1, both excluded

All Answers

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

import numpy as np
x = np.linspace(0,1,12,endpoint=True)[1:-1]
print(x)

Sample Output:

[ 0.09090909  0.18181818  0.27272727  0.36363636  0.45454545  0.5454545
5                                                                      
  0.63636364  0.72727273  0.81818182  0.90909091]

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