from typing import Any
import math


def nan_to_none(value: Any) -> Any:
    """Convert NaN values to None.

    Parameters
    ----------
    value: any
        Cell value.

    Returns
    -------
    any
    """
    if isinstance(value, int) or isinstance(value, float):
        return None if math.isnan(value) else value
    return value