I have a function which can accept either a list or a numpy array.
In either case, the list/array has a single element (always). I just need to return a float.
I would simply use,
np.asarray(input, dtype=np.float)[0]
input
ndarray
np.asarray
list