B spline curve generation in Python
In line 15 use the half-open interval, i.e.,

if u&gt;=t[0][i] and u&lt;t[0][i+1]:


Otherwise, at knot values, you evaluate two basis functions at the k=1 basis when you only want one. This causes the wrong evaluation of the basis function at the knot values and therefore the spikes.