Skip to content

Commit cfc9fd4

Browse files
authored
accept np.ndarray as index (#407)
1 parent e6cbaab commit cfc9fd4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dpdata/system.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def __str__(self):
339339

340340
def __getitem__(self, key):
341341
"""Returns proerty stored in System by key or by idx"""
342-
if isinstance(key, (int, slice, list)):
342+
if isinstance(key, (int, slice, list, np.ndarray)):
343343
return self.sub_system(key)
344344
return self.data[key]
345345

0 commit comments

Comments
 (0)