How to use the finta.utils.to_dataframe function in finta

To help you get started, we’ve selected a few finta examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github peerchemist / finta / tests / test_utils_unit.py View on Github external
def test_resample_calendar():

    df = to_dataframe(data)
    assert isinstance(resample(df, "W-Mon"), DataFrame)
    assert list(resample(df, "W-Mon").index.values[-2:]) == [
        numpy.datetime64("2019-05-06T00:00:00.000000000"),
        numpy.datetime64("2019-05-13T00:00:00.000000000"),
    ]
github peerchemist / finta / tests / test_utils_unit.py View on Github external
def test_trending_up():

    df = to_dataframe(data)
    ma = TA.HMA(df)
    assert isinstance(trending_up(ma, 10), Series)

    assert not trending_up(ma, 10).values[-1]
github peerchemist / finta / tests / test_utils_unit.py View on Github external
def test_to_dataframe():

    assert isinstance(to_dataframe(data), DataFrame)
github peerchemist / finta / tests / test_utils_unit.py View on Github external
def test_trending_down():

    df = to_dataframe(data)
    ma = TA.HMA(df)
    assert isinstance(trending_down(ma, 10), Series)

    assert trending_down(ma, 10).values[-1]
github peerchemist / finta / tests / test_utils_unit.py View on Github external
def test_resample():

    df = to_dataframe(data)
    assert isinstance(resample(df, "2d"), DataFrame)
    assert list(resample(df, "2d").index.values[-2:]) == [
        numpy.datetime64("2019-05-05T00:00:00.000000000"),
        numpy.datetime64("2019-05-07T00:00:00.000000000"),
    ]