(series)
return count
Count the number of null or zero values at the bottom of a series.
Count the number of null or zero values at the bottom of a series.
Count the number of null or zero values at the bottom of a series .
def count_placeholders(series):
    """
    Count the number of null or zero values at the bottom of a series.
    """
    count = 0
    series = series.reset_index(drop=True)

    for i in range(series.size-1, -1, -1):
        if pd.isnull(series[i]) or series[i] == 0:
            count += 1
        else:
            break

    return count
def count_placeholders ( series ) : count = 0 series = series . reset_index ( drop = True ) for i in range ( series . size - 1 , - 1 , - 1 ) : if pd . isnull ( series [ i ] ) or series [ i ] == 0 : count += 1 else : break return count