def percent_nan(data_series):
    """
    For data_series, calculate what proportion of rows are NaN.
    @param data_series: data to check for NaNs
    @type data_series: Series
    @return: A number representing the proportion of data in data_series that is NaN
    @rtype: Float
    """
    nan_count = data_series.isna().sum()
    row_count = len(data_series)
    if row_count == 0:
        percent = 0
    else:
        percent = nan_count/row_count

    return percent