@jnothman Thanks. But I do think it does calculate the sparse_std. The only thing that I think is missing, is that it should be

    X_std[ii] = sqrt((X_sum_ii + (n_samples - nnz_ii) * X_mean_ii * X_mean_ii) / n_samples)

My apologies if I am wrong.