def fastgrad(a, win=<NUM_LIT:11>):
<EOL>if win % <NUM_LIT:2> == <NUM_LIT:0>:<EOL><INDENT>win += <NUM_LIT:1>  <EOL><DEDENT>wins = rolling_window(a, win, '<STR_LIT>')<EOL>a = map(lambda x: np.polyfit(np.arange(win), x, <NUM_LIT:1>)[<NUM_LIT:0>], wins)<EOL>return np.array(list(a))<EOL>
Returns rolling - window gradient of a.

Function to efficiently calculate the rolling gradient of a numpy
array using 'stride_tricks' to split up a 1D array into an ndarray of
sub - sections of the original array, of dimensions [len(a) - win, win].

Parameters
----------
a : array_like
    The 1D array to calculate the rolling gradient of.
win : int
    The width of the rolling window.

Returns
-------
array_like
    Gradient of a, assuming as constant integer x - scale.