Hello Mathieu,
I appreciate the quick response. Sorry I should have provided a little more clarity. What you provide will work for a single asset as I noted in my first response but what I really need is to be able to apply this over X number of asset. From the API doc when working with Custom factors
*inputs are M x N numpy arrays, where M is the window_length and N is the number of securities (usually around ~8000 unless a mask is provided). *inputs are trailing data windows. Note that there will be one M x N array for each BoundColumn provided in the factor's inputs list. The data type of each array will be the dtype of the corresponding BoundColumn.
Below is the exact array (minus the dates I added) retuned by the notebook of a random fundamental I chose but staged to the exact scenario that I am trying to get to where each column corresponds to an asset over a 2 day period
1/2/2015 - [[ 60000. 133. 84400. ..., nan nan nan]
[ 60000. 133. 84400. ..., nan nan nan]
[ 60000. 133. 97000. ..., nan nan nan]
...,
[ 60000. 133. 97000. ..., nan nan nan]
[ 60000. 133. 97000. ..., nan nan nan]
[ 60000. 133. 97000. ..., nan nan nan]]
1/1/2015 - [[ 60000. 133. 84400. ..., nan nan nan]
[ 60000. 133. 97000. ..., nan nan nan]
[ 60000. 133. 97000. ..., nan nan nan]
...,
[ 60000. 133. 97000. ..., nan nan nan]
[ 60000. 133. 97000. ..., nan nan nan]
[ 60000. 133. 97000. ..., nan nan nan]]
if I were to slice this using x[0] equlivalnt to using the .latest attribute I would get below for the two day period
[ 60000. 133. 84400. ..., nan nan nan]
[ 60000. 133. 84400. ..., nan nan nan]
retrieving the day prior using x[1] give s
[ 60000. 133. 84400. ..., nan nan nan]
[ 60000. 133. 97000. ..., nan nan nan]
on 1/1/2015 you can see that the delta for the third asset went from 97000 down to 84400 indicating a 12% decline. The next day the prior day value slicing with the same action as above would pull a latest value of 84400 and a prior values of 84400 indicating no change. I am trying to get the last unique value prior to the latest for each asset returned by the Custom Factor. Which in this case would be the 97000. I would like the keep the pulling this value preserving the delta change until either my window length expired or a new value comes in an resets the delta
Hope this make more sense now