[1bd16f]: / tests / test_permutation_entropy.py

Download this file

19 lines (12 with data), 363 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
import numpy
import unittest
from pyeeg import permutation_entropy
class PermutationEntropyTests(unittest.TestCase):
def test_permutation_entropy(self):
data = numpy.asarray([1, 2, 4, 5, 12, 3, 4, 5])
self.assertEqual(
permutation_entropy(data, 5, 1),
2.0
)
if __name__ == '__main__':
unittest.main()