Siqi Hu Posted October 13, 2023 Share Posted October 13, 2023 (edited) Hello, Does there exist a method to pull the data with some of them need to be applied with a formula? For example, I want to pull several signals all at once, including "SP", "MODE", "OUT", "PV". For SP and MODE, these attributes are categorical, so there are only four possibilities, for instance, for their values, which are 0, 1, 8, 9. However, with spy.pull() function, these attributes will be interpolated. So I have to pull first the data for "OUT", "PV", and again pull the data for "SP" and "MODE" with a parameter "calculation", as follows: # My current method is with 2 pull functions, but they took too much time for many signals my_pull_1 = spy.pull( my_search.query("Name not in ('MODE', 'SP')"), start=start, end=end, grid=grid, ) my_pull_2 = spy.pull( my_search.query("Name in ('MODE', 'SP')"), start=start, end=end, grid=grid, calculation="$signal.toStep()" ) Since in my_search dataframe, there could be thousands of different "MODE" and "SP" signals, pulling the data twice will be very slow. Is there a way that I can pull only once the data, and apply the function to only part of the signals, like defining the formula parameter for the function? # what I would like to realize is something like this my_pull = spy.pull( my_search, start=start, end=end, grid=grid, formula="$Mode.toStep()", formula_parameters={ "$Mode": my_search[my_search['Name'] == 'MODE'] } ) Thanks in advance, Siqi Edited October 13, 2023 by Siqi Hu Link to comment Share on other sites More sharing options...
Seeq Team Amanda Chng Posted October 16, 2023 Seeq Team Share Posted October 16, 2023 Hi Siqi, If the tags being searched remains the same, splitting the spy.pull() into two separate functions will not take much longer than if the signals were pulled in one signal. In your case, you can specify grid = None to avoid the interpolation, rather than using the formula parameter. Your pull should look something like this my_pull_1 = spy.pull( my_search.query("Name not in ('MODE', 'SP')"), start=start, end=end ) my_pull_2 = spy.pull( my_search.query("Name in ('MODE', 'SP')"), start=start, end=end, grid=None ) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now