I have always used np.arange
. I recently came across np.linspace
. I am wondering what exactly is the difference between them... Looking at their documentation:
Return evenly spaced values within a given interval.
Return evenly spaced numbers over a specified interval.
The only difference I can see is linspace
having more options... Like choosing to include the last element.
Which one of these two would you recommend and why? And in which cases is np.linspace
superior?