def is_number(s):
    """
    Checks if the given string is an int or a float. Numbers with thousands
    separators (e.g. "1,000.12") are also recognised. Returns true of the string
    contains only digits and punctuation, e.g. 12/23
    """
    try:
        float(s)
        is_float = True
    except ValueError:
        is_float = False

    is_only_digits_or_punct = True
    for ch in s:
        if ch.isalpha():
            is_only_digits_or_punct = False
            break

    return is_float or is_only_digits_or_punct