title: What is the difference between np.linspace and np.arange?
body: <p>I have always used <code>np.arange</code>. I recently came across <code>np.linspace</code>. I am wondering what exactly is the difference between them... Looking at their documentation:</p>
  <p><a href="https://numpy.org/doc/1.18/reference/generated/numpy.arange.html" rel="noreferrer"><code>np.arange</code></a>:</p>
  <blockquote>
  <p>Return evenly spaced values within a given interval.</p>
  </blockquote>
  <p><a href="https://numpy.org/devdocs/reference/generated/numpy.linspace.html" rel="noreferrer"><code>np.linspace</code></a>:</p>
  <blockquote>
  <p>Return evenly spaced numbers over a specified interval.</p>
  </blockquote>
  <p>The only difference I can see is <code>linspace</code> having more options... Like choosing to include the last element.</p>
  <p>Which one of these two would you recommend and why? And in which cases is <code>np.linspace</code> superior?</p>