Although I can't reproduce it on my computer, this sounds like a floating-point rounding error problem. The np.arange documentation:
When using a non-integer step, such as 0.1, the results will often not
be consistent. It is better to use linspace for these cases.
So using linspace is probably best. Here is an example using linspace:
import numpy as np
amp_start = 0.8
amp_step = 0.1
amp_end = 1.0
amp_end = (np.ceil(amp_end / amp_step)) * amp_step
amp_end_2 = (np.ceil(amp_end / amp_step)) * amp_step + amp_step
print(amp_end)
field_amp_range = np.linspace(amp_start, amp_end, np.rint((amp_end-amp_start)/amp_step).astype('int')+1)
field_amp_range_2 = np.linspace(amp_start, amp_end_2, np.rint((amp_end_2-amp_start)/amp_step).astype('int')+1)
field_amp_range = field_amp_range.tolist()
print(amp_end, amp_end_2, field_amp_range, field_amp_range_2)
Alternatively, if you
really want to keep using np.arange, and you're sure that there is an integer number of steps between the start and end values, you could add a small number to the end value, so that the rounding off does not matter (or subtract it, if you do not want the end value to be encluded in your list). In that case your code would become:
import numpy as np
amp_start = 0.
amp_step = 0.1
amp_end = 1.0
amp_end = (np.ceil(amp_end / amp_step)) * amp_step
amp_end_2 = (np.ceil(amp_end / amp_step)) * amp_step + amp_step
print(amp_end)
field_amp_range = np.arange(amp_start, amp_end+amp_step/100, amp_step)
field_amp_range_2 = np.arange(amp_start, amp_end_2+amp_step/100, amp_step)
print(amp_end, amp_end_2, field_amp_range, field_amp_range_2)