(value)
Returns value in single quotes if value is not a number

    >>> quote_nan('foo')
    "'foo'"
    >>> quote_nan('1')
    '1'
Returns value in single quotes if value is not a number
Returns value in single quotes if value is not a number
def quote_nan(value):
    """
    Returns value in single quotes if value is not a number

    >>> quote_nan('foo')
    "'foo'"
    >>> quote_nan('1')
    '1'

    """
    try:
        float(value)
        return value
    except ValueError:
        return "'{}'".format(value)
def quote_nan ( value ) : try : float ( value ) return value except ValueError : return "'{}'" . format ( value )