Pandas iteration over rows for features calculation
Just some stylistic suggestions

Constants

Constants in your program should be UPPERCASE. (PEP 8)

bins -&gt; BINS
short_window -&gt; SHORT_WINDOW
long_window -&gt; LONG_WINDOW
price -&gt; PRICE


Docstrings

You can add docstrings to your functions to allow more description about the function and
about the parameters it accepts and the value(s) it returns, if any. (PEP 8)

def vap(row, df, short_window, long_window, bins):
    """
    Description Here

    :param row: Description Here
    :param df: Description Here
    :param short_window: Description Here
    :param long_window: Description Here
    :param bins: Description Here

    :return: Description Here
    """


Type Hints

You can add type hints to your functions to show what types of parameters are accepted, and what
types are returned.

You can also use typing's NewVar to create custom types to return.

from typing import List

PandasTimeStamp = NewType("PandasTimeStamp", pd._libs.tslibs.timestamps.Timestamp)

def vap(row: int, df: pd.DataFrame, short_window: int, long_window: int, bins: int) -&gt; List, PandasTimeStamp:
    ...