import math


def value_is_nan(value):
    """Check if value is nan
    nan is a special dataframe value to indicate missing data
    """
    # We coerces nan to string for group annotations (SCP-2545)
    # string value 'nan' should also be considered value_is_nan=True
    if str(value).lower() == "n/a":
        return True
    try:
        number = float(value)
        return math.isnan(number)
    except TypeError:
        return False
    except ValueError:
        return False