def determine_number_type(values):
    # Test if all values are whole numbers, if so coerce floats it ints
    integral = True

    for v in values:
        if v and v % 1 != 0:
            integral = False
            break

    if integral:
        return int
    else:
        return float
Determine if a column of numbers in an XLS file are integral.
dataset/ETHPy150Open pandaproject/panda/panda/utils/xls.py/determine_number_type