We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6bcd303 commit 5caf252Copy full SHA for 5caf252
pandas/_libs/lib.pyx
@@ -981,16 +981,14 @@ def get_level_sorter(
981
982
@cython.boundscheck(False)
983
@cython.wraparound(False)
984
-def count_level_2d(ndarray[uint8_t, ndim=2, cast=True] mask,
+def count_level_2d(const uint8_t[:, :] mask,
985
const intp_t[:] labels,
986
Py_ssize_t max_bin,
987
):
988
cdef:
989
- Py_ssize_t i, j, k, n
+ Py_ssize_t i, j, k = mask.shape[1], n = mask.shape[0]
990
ndarray[int64_t, ndim=2] counts
991
992
- n, k = (<object>mask).shape
993
-
994
counts = np.zeros((n, max_bin), dtype="i8")
995
with nogil:
996
for i in range(n):
0 commit comments