(value, counter, result)
return counter, result + 1
Calculate the window count with new value.
Calculate the window count with new value.
Calculate the window count with new value .
def put_count(value, counter, result):
    """Calculate the window count with new value."""
    # rolling.count() fills front of the resulting array by nans according to min_periods using counter
    # Ex: s = pd.Series([1, 2, np.nan]) ->  s.rolling(window=3, min_periods=2).count() -> pd.Series([np.nan, 2.0, 2.0])
    counter += 1
    if numpy.isnan(value):
        return counter, result

    return counter, result + 1
def put_count ( value , counter , result ) : # rolling.count() fills front of the resulting array by nans according to min_periods using counter # Ex: s = pd.Series([1, 2, np.nan]) ->  s.rolling(window=3, min_periods=2).count() -> pd.Series([np.nan, 2.0, 2.0]) counter += 1 if numpy . isnan ( value ) : return counter , result return counter , result + 1