Skip to content

Commit a701c1e

Browse files
Update StackedSparseArray.py
1 parent 3e5ff33 commit a701c1e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sparsestack/StackedSparseArray.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
# -*- coding: utf-8 -*-
22
import numpy as np
33
from scipy.sparse import coo_matrix
4-
from scipy.sparse.sputils import get_index_dtype
54
from .utils import join_arrays
65

76

87
_slicing_not_implemented_msg = "Wrong slicing, or option not yet implemented"
98

109

10+
def get_index_dtype(maxval):
11+
if maxval <= np.iinfo(np.int32).max:
12+
return np.int32
13+
return np.int64
14+
15+
1116
class StackedSparseArray:
1217
""" 2.5D sparse matrix in COO-style with multiple possible entries per i-j-position.
1318

0 commit comments

Comments
 (0)