def sparse_var(X):
    '''
    Compute variance from
    :param X:
    :return:
    '''
    Xc = X.copy()
    Xc.data **= 2
    return np.array(Xc.mean(axis=0) - np.power(X.mean(axis=0), 2))[0]
def sparse_var ( X ) : Xc = X . copy ( ) Xc . data **= 2 return np . array ( Xc . mean ( axis = 0 ) - np . power ( X . mean ( axis = 0 ) , 2 ) ) [ 0 ]
Compute variance from
    :param X:
    :return: