Skip to content

Commit ee21da2

Browse files
committed
also check sliding_window for pandas series
1 parent 15b8278 commit ee21da2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/feature_extraction/test_motifs.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import numpy as np
1010
import numpy.testing as npt
1111
from tsfresh.feature_extraction import motifs
12-
12+
import pandas as pd
1313

1414
class TestMotifSubelements(unittest.TestCase):
1515
def setUp(self):
@@ -54,6 +54,10 @@ def test_sliding_window(self):
5454
expected_result = np.array([[0, 1], [1, 2], [2, 3], [3, 4]])
5555
npt.assert_array_equal(expected_result, motifs._sliding_window(data, pattern_length=2))
5656

57+
data = pd.Series(np.arange(5))
58+
expected_result = np.array([[0, 1], [1, 2], [2, 3], [3, 4]])
59+
npt.assert_array_equal(expected_result, motifs._sliding_window(data, pattern_length=2))
60+
5761
def test_match_scores(self):
5862
answer = motifs._match_scores(self.s1, self.s1[5:10])
5963
self.assertEqual(answer[5], 0.0)

0 commit comments

Comments
 (0)