numpy arrange oddly including endpoint when it shouldn't
Okay, answered my own question (rly just wanted to post on stackoverflow).
It's best to use numpy.linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None, axis=0), and just set num to (start - stop)/spacing (+1 if endpoint=True).
Can anyone help with best practices for avoiding this type of problem?
in: np.arrange(1, 2.2, .2)
out: array([1. , 1.2, 1.4, 1.6, 1.8, 2. , 2.2])
Must have something to do with binary/base10 difficulties, as
in: np.arrange(1, 2.2, .2)[6]
out: 2.1999999999999997
python version:  3.6.8 |Anaconda, Inc.| (default, Dec 29 2018, 19:04:46)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]
numpy version: :  1.16.3