Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9038b45 commit 3488dc7Copy full SHA for 3488dc7
1 file changed
examples/units/basic_units.py
@@ -5,6 +5,7 @@
5
6
"""
7
8
+from distutils.version import LooseVersion
9
import math
10
11
import numpy as np
@@ -154,8 +155,9 @@ def __str__(self):
154
155
def __len__(self):
156
return len(self.value)
157
- def __getitem__(self, key):
158
- return TaggedValue(self.value[key], self.unit)
+ if LooseVersion(np.__version__) >= '1.20':
159
+ def __getitem__(self, key):
160
+ return TaggedValue(self.value[key], self.unit)
161
162
def __iter__(self):
163
# Return a generator expression rather than use `yield`, so that
0 commit comments