I wrote a code to develop a NumPy array that contains values from 0 to 1(exclusive). It is part of my assignment to develop an array containing values between 0 and 1 using NumPy. My code didn’t work properly. It is also giving values like 0 and 1 but I want values between 0 and 1 only. It is my code below:
import numpy as np
vector = np.linspace(0, 1, 12)
print(vector)
Can someone correct my code and highlight the mistake that I made? It will be great if I get some alternative methods of achieving my goal.