Try this:
import numpy as np
np.arange(0,3*0.1,0.1)
Output will be: array([ 0. , 0.1, 0.2, 0.3])
This is incredible because for np.arange 'Values are generated within the half-open interval [start, stop)'. I tried other numbers and found only the multiples of 3 would trigger such phenomenon:
np.arange(0,2*0.1,0.1).shape
# 2
np.arange(0,3*0.1,0.1).shape
# 4
np.arange(0,4*0.1,0.1).shape
# 4
np.arange(0,5*0.1,0.1).shape
# 5
np.arange(0,6*0.1,0.1).shape
# 7
I'm so confused now. Can somebody help me?