(source_dict, attribute, replace_with=None)
Replaces a numpy.nan value within dict with another value.

    Args:
        source_dict: a dictionary.
        attribute: string that is a key to the dictionary, in which
            numpy.nan values will be replaced by the supplied value.
        replace_with: the value that will be used as a replacement for
            the numpy.nan. If not supplied an empty list will be used.
Replaces a numpy.nan value within dict with another value.
Replaces a numpy . nan value within dict with another value .
def _fix_np_nan(source_dict, attribute, replace_with=None):
    """Replaces a numpy.nan value within dict with another value.

    Args:
        source_dict: a dictionary.
        attribute: string that is a key to the dictionary, in which
            numpy.nan values will be replaced by the supplied value.
        replace_with: the value that will be used as a replacement for
            the numpy.nan. If not supplied an empty list will be used.
    """
    if replace_with is None:
        replace_with = []

    value = source_dict.get(attribute)
    try:
        if numpy.isnan(value):
            source_dict[attribute] = replace_with
    except TypeError:
        # The value does not need to be changed.
        pass
def _fix_np_nan ( source_dict , attribute , replace_with = None ) : if replace_with is None : replace_with = [ ] value = source_dict . get ( attribute ) try : if numpy . isnan ( value ) : source_dict [ attribute ] = replace_with except TypeError : # The value does not need to be changed. pass