def numeric_cast (v):
    """Try to cast values to int or to float"""
    if type(v)== str:
        try:
            v = int(v)
        except ValueError:
            try:
                v = float(v)
            except ValueError:
                pass
    return v