isnan only accepts floats

have to either check for the string type first or coerce to float first or it will throw a TypeError on 'nan'. I've chosen the latter.