#NEWLINE# def sen_seasonal_slopes( x ) : #NEWLINE# #INDENT# x = ma . array ( x , subok = True , copy = False , ndmin = 2 ) #NEWLINE# ( n , _ ) = x . shape #NEWLINE# szn_slopes = ma . vstack ( [ ( ( x [ ( i + 1 ) : ] - x [ i ] ) / np . arange ( 1 , ( n - n ) ) [ : , None ] ) for i in range ( n ) ] ) #NEWLINE# szn_medslopes = ma . median ( szn_slopes , axis = 0 ) #NEWLINE# medslope = ma . median ( szn_slopes , axis = None ) #NEWLINE# return ( szn_medslopes , medslope )