Skip to content

Tag: python

Compare variables through a range

I’ve 2 DataFrames where one gives me 3 Dates and a slope, and the other one gives me a calendar with prices. I’m want to know if any High price in Dates breaks the line between Date1 and Date3 of the slope_and_dates DataFrame. I expect an extra column in slopes_and_dates called Break where I can s…

`torch.gather` without unbroadcasting

I have some batched input x of shape [batch, time, feature], and some batched indices i of shape [batch, new_time] which I want to gather into the time dim of x. As output of this operation I want a tensor y of shape [batch, new_time, feature] with values like this: In Tensorflow, I can accomplish this by usi…