(*args, **kwargs)
return result[~np.isnan(result)]
Return unique values while disregarding missing (np.nan) values.
    Supports sparse or dense matrices.
Return unique values while disregarding missing (np.nan) values.
    Supports sparse or dense matrices.
Return unique values while disregarding missing ( np . nan ) values . Supports sparse or dense matrices .
def nanunique(*args, **kwargs):
    """ Return unique values while disregarding missing (np.nan) values.
    Supports sparse or dense matrices. """
    result = unique(*args, **kwargs)

    if isinstance(result, tuple):
        result, counts = result
        non_nan_mask = ~np.isnan(result)
        return result[non_nan_mask], counts[non_nan_mask]

    return result[~np.isnan(result)]
def nanunique ( * args , * * kwargs ) : result = unique ( * args , * * kwargs ) if isinstance ( result , tuple ) : result , counts = result non_nan_mask = ~ np . isnan ( result ) return result [ non_nan_mask ] , counts [ non_nan_mask ] return result [ ~ np . isnan ( result ) ]