I want to verify that values in a CSV are integers
and report an error if they are not. Being an amateur, I thought I had it figured out if the user entered '8k' or whatever as a value by using this:
try:
int(value)
except ValueError:
print("No Deal, Howie!")
I completely overlooked the possibility that a user can enter 8.8, which is unacceptable as well. Unfortunately, I can't use:
if type(value) == int
because pandas dataframe turns all the ints
in my CSV into numpy.float64
. What can I do about this?