Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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"),
]
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"),
]
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"),
]
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"),
]