Repository URL to install this package:
|
Version:
4.0.1 ▾
|
import numpy as np
import pytest
from sarus_statistics.ops.std.local import std
np.random.seed(0)
NOISE = 1e-9
def test_std(ops_data, admin_cols):
public, user_col, weights = admin_cols
std_value = std(
ops_data,
data_col='integer_pv',
user_col=user_col,
private_col=public,
weight_col=weights,
noise_mean=NOISE,
noise_square=NOISE,
noise_count=NOISE,
bounds=(0, 10),
max_multiplicity=10,
)
assert pytest.approx(std_value, 1e-2) == ops_data['integer_pv'].std()