Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #225 from nsmith-/stickyjaggedbool
Browse files Browse the repository at this point in the history
Make methods stick on jagged getitem[jagged bool mask]
  • Loading branch information
jpivarski authored Dec 19, 2019
2 parents b9efd22 + 7823391 commit 5c488e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion awkward/array/jagged.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ def __getitem__(self, where):
elif head.shape == self.shape and issubclass(head._content.dtype.type, (self.numpy.bool, self.numpy.bool_)):
index = self.localindex + self.starts
flatindex = index.flatten()[head.flatten()]
return self.JaggedArray.fromcounts(head.sum(), self._content[flatindex])
return type(self).fromcounts(head.sum(), self._content[flatindex])

else:
raise TypeError("jagged index must be boolean (mask) or integer (fancy indexing)")
Expand Down

0 comments on commit 5c488e2

Please sign in to comment.