Michele Scarpa Posted April 17 Share Posted April 17 Hello, I have a dataset that reports the number of hours worked per day and the number of events occurred that day. I would like to aggregate data over the last 100 worked hours so I need a previous node function that check a condition: day worked hours events avg per 100 h 1 36 1 2 48 0 3 19 0 4 26 1 5 42 2 3 6 34 1 4 7 22 0 3 8 45 1 2 9 50 2 3 10 52 1 3 a function similar to pandas.rolling (https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.rolling.html) Is there any way to do this in spotfire? Thanks Link to comment Share on other sites More sharing options...
Alain Martens Posted April 17 Share Posted April 17 Hi Michele, Since you have already identified the Python function that suits your needs, why not create a Python Data Function in Spotfire that returns this rolling average as an additional column in your data table? Thanks, Alain Link to comment Share on other sites More sharing options...
Michele Scarpa Posted May 7 Author Share Posted May 7 Hi Alain, thank you for replying. I was trying to do as you suggested. bu I get the following error when trying to run the data function: Could it be a license or an installation issue? Thank Michele Link to comment Share on other sites More sharing options...
Gaia Paolini Posted May 7 Share Posted May 7 It is likely something to do with your way of exporting the output back into Spotfire. Can you share details of your data function and the inputs/outputs you defined? 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