def nonzeroCoef(beta, bystep = False):
    result = scipy.absolute(beta) > 0
    if len(result.shape) == 1:
        result = scipy.reshape(result, [result.shape[0], 1])
    if not bystep:
        result = scipy.any(result, axis = 1)