I am working on a project where I need to deal with high-frequency trading data and want to write a function that will allow the user to subset the data based on dollar-volume data. Currently, we have tick data, so in a minute, there can be 100's of observations. Instead, I want to filter the data based on a user-given dollar-volume threshold. In other words: at every tick, there is a price and a volume (100$, 10 shares traded). Here, P*V = 100 * 10 = 1000. If the user inputs "10000", I want to condense the dataframe so that now, every observation or "bar" is the observation after reaching this number (just sum every P*V until you hit the threshold, and thats your new observation). I dont really use Python so I have no idea how to do this. Some people said use groupby but im not sure how