In above code, start=2, stop=10 and num=5. We are getting 5 elements starting from 2 and ending at 10 with an equal increment of 2.
endpoint
In above code we have used included the stop value in our element ( i.e 10 ) . This is because default value of option endpoint=True. Let us change it to False and see the result.
Now the stop value 10 is not included in our output. Now the increment is adjusted to 1.6 to return 5 equal incremental elements in our output.
retstep
We can get the step value used by numpy to create the array by using retstep=True. The option retstep takes Boolean value and its default value is False.
In case of linspace() we give the number of samples ( num ) and internally the increments ( or evenly spaced steps) are decided based on start and stop values.
In case of arange() we give the step value and number of elements are internally decided.