def to_numeric(s):
    """Convert string to int or float

    Args:
        s (str): string to be converted to numeric

    Returns:
        int or float
    """
    try:
        return int(s)
    except ValueError:
        return float(s)