computes mean spectral energy for each variable in a segmented time series

def mse(X):
    ''' computes mean spectral energy for each variable in a segmented time series '''
    return np.mean(np.square(np.abs(np.fft.fft(X, axis=1))), axis=1)