mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-28 04:52:07 +00:00
* Split out a rolling submenu for the rolling functions * Make a performance and a stats submenu. * Test the statistics functions * lint * lint * dupe test * pylint * ruff * Try tests quick * black magic signature funcs * fix my custom tests * Fix the existing imports/urls * push the api update * okay I figured out whats going on * this should be all of them * Correct docstringing examples --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com>
26 lines
586 B
Python
26 lines
586 B
Python
import pandas as pd
|
|
import pytest
|
|
from openbb_quantitative.statistics import kurtosis_, mean_, skew_, std_dev_, var_
|
|
|
|
test_data = pd.Series([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
|
|
|
|
|
|
def test_kurtosis():
|
|
assert kurtosis_(test_data) == pytest.approx(-1.224, abs=1e-3)
|
|
|
|
|
|
def test_skew():
|
|
assert skew_(test_data) == pytest.approx(0.0, abs=1e-3)
|
|
|
|
|
|
def test_std_dev():
|
|
assert std_dev_(test_data) == pytest.approx(2.872, abs=1e-3)
|
|
|
|
|
|
def test_mean():
|
|
assert mean_(test_data) == pytest.approx(5.5, abs=1e-3)
|
|
|
|
|
|
def test_var():
|
|
assert var_(test_data) == pytest.approx(8.25, abs=1e-3)
|