We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f005306 commit d8d53bbCopy full SHA for d8d53bb
1 file changed
numcodecs/delta.py
@@ -63,12 +63,7 @@ def encode(self, buf):
63
enc[0] = arr[0]
64
65
# compute differences
66
- # using np.subtract for in-place operations
67
- if arr.dtype == bool:
68
- np.not_equal(arr[1:], arr[:-1], out=enc[1:])
69
- else:
70
- np.subtract(arr[1:], arr[:-1], out=enc[1:])
71
-
+ enc[1:] = np.diff(arr)
72
return enc
73
74
def decode(self, buf, out=None):
0 commit comments