torchdms.utils.positions_in_list

torchdms.utils.positions_in_list(series, items)[source]

Give the positions of the things in a series relative to a list of items.

Example: >>> positions_in_list(pd.Series([4., -3., -1., 9.]), [-2., 0.]) 0 2 1 0 2 1 3 2 dtype: int64

The first item is 2 because 4 is bigger than -2 and 0. The second item is 0 because -3 is smaller than everything. The third item is 1 because -1 is between -2 and 0.