Skip to content

Commit 9a7fe54

Browse files
committed
Use inplace subtract in Delta encoding
1 parent 652a58e commit 9a7fe54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

numcodecs/delta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def encode(self, buf):
6464
enc[0] = arr[0]
6565

6666
# compute differences
67-
enc[1:] = np.diff(arr)
67+
np.subtract(arr[1:], arr[0:-1], out = enc[1:])
6868

6969
return enc
7070

0 commit comments

Comments
 (0)