def count_nans(df):
    """
    Returns the number of NaN values in the dataset.
        Parameters:
            df (pandas DataFrame): Dataset to perform calculation on
        Returns:
            num_nans (int): Number of NaN values in df
    """
    num_nans = df.isnull().sum().sum()
    return num_nans