def num(s):
    """
    Returns integer or float from string

    :param s: :py:func:`str` string to be transformed to numeric

    :returns: numeric type
    
    """
    try:
        return int(s)
    except ValueError:
        return float(s)
