Пример #1
0
def test_segment_simple():
    x = np.arange(6)
    segs = list(copper.segment(x, 2))
    assert_equal(segs[0], np.array([[0, 1]]))
    assert_equal(segs[1], np.array([[2, 3]]))
    assert len(segs) == 3
Пример #2
0
def test_segment_overlap():
    x = np.random.randn(100)
    segs = list(copper.segment(x, 10, overlap=5))
    assert_equal(segs[0][:, -5:], segs[1][:, :5])