def _df_nans_not_allowed(df_name, df):
    """ 
    Internal function that raises an exception if a user passed a DataFrame 
    with NANs when not allowed.
    """
    if df is None:
        raise TypeError('Expected DataFrame {}'.format(df_name))
    if df.isnull().values.any():
        raise TypeError('Found unexpected NaN values in DataFrame "{0}".'.
            format(df_name))
